Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (5)
......@@ -90,24 +90,34 @@
#endif
/* Function attributes for compiler warnings */
#ifdef __GNUC__
# define VLC_DEPRECATED __attribute__((deprecated))
# if VLC_GCC_VERSION(6,0)
# define VLC_DEPRECATED_ENUM __attribute__((deprecated))
#if defined __has_attribute
# if __has_attribute(warning)
# define VLC_WARN_CALL(w) VLC_NOINLINE_FUNC __attribute__((warning((w))))
# else
# define VLC_DEPRECATED_ENUM
# define VLC_WARN_CALL(w)
# endif
# if defined( _WIN32 ) && !defined( __clang__ )
# define VLC_FORMAT(x,y) __attribute__ ((format(gnu_printf,x,y)))
# if __has_attribute(error)
# define VLC_ERROR_CALL(e) VLC_NOINLINE_FUNC __attribute__((error((e))))
# else
# define VLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
# define VLC_ERROR_CALL(e)
# endif
# define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
# define VLC_MALLOC __attribute__ ((malloc))
# define VLC_USED __attribute__ ((warn_unused_result))
#else
# if __has_attribute(unused)
# define VLC_UNUSED_FUNC __attribute__((unused))
# else
# define VLC_UNUSED_FUNC
# endif
# if __has_attribute(noinline)
# define VLC_NOINLINE_FUNC __attribute__((noinline))
# else
# define VLC_NOINLINE_FUNC
# endif
# if __has_attribute(deprecated)
# define VLC_DEPRECATED __attribute__((deprecated))
# else
/**
* Deprecated functions or compound members annotation
*
......@@ -117,8 +127,67 @@
*
* Use \ref VLC_DEPRECATED_ENUM instead for enumeration members.
*/
# define VLC_DEPRECATED
# define VLC_DEPRECATED
# endif
# if __has_attribute(malloc)
# define VLC_MALLOC __attribute__((malloc))
# else
/**
* Heap allocated result function annotation
*
* Use this macro to annotate a function that returns a pointer to memory that
* cannot alias any other valid pointer.
*
* This is primarily used for functions that return a pointer to heap-allocated
* memory, but it can be used for other applicable purposes.
*
* \warning Do not use this annotation if the returned pointer can in any way
* alias a valid pointer at the time the function exits. This could lead to
* very weird memory corruption bugs.
*/
# define VLC_MALLOC
# endif
# if __has_attribute(warn_unused_result)
# define VLC_USED __attribute__((warn_unused_result))
# else
/**
* Used result function annotation
*
* Use this macro to annotate a function whose result must be used.
*
* There are several cases where this is useful:
* - If a function has no side effects (or no useful side effects), such that
* the only useful purpose of calling said function is to obtain its
* return value.
* - If ignoring the function return value would lead to a resource leak
* (including but not limited to a memory leak).
* - If a function cannot be used correctly without checking its return value.
* For instance, if the function can fail at any time.
*
* The compiler may warn if the return value of a function call is ignored.
*/
# define VLC_USED
# endif
#endif
#ifdef __GNUC__
# if VLC_GCC_VERSION(6,0)
# define VLC_DEPRECATED_ENUM __attribute__((deprecated))
# else
# define VLC_DEPRECATED_ENUM
# endif
# if defined( _WIN32 ) && !defined( __clang__ )
# define VLC_FORMAT(x,y) __attribute__ ((format(gnu_printf,x,y)))
# else
# define VLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
# endif
# define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
#else
/**
* Deprecated enum member annotation
*
......@@ -151,39 +220,6 @@
* This is primarily intended for localization functions such as gettext().
*/
# define VLC_FORMAT_ARG(x)
/**
* Heap allocated result function annotation
*
* Use this macro to annotate a function that returns a pointer to memory that
* cannot alias any other valid pointer.
*
* This is primarily used for functions that return a pointer to heap-allocated
* memory, but it can be used for other applicable purposes.
*
* \warning Do not use this annotation if the returned pointer can in any way
* alias a valid pointer at the time the function exits. This could lead to
* very weird memory corruption bugs.
*/
# define VLC_MALLOC
/**
* Used result function annotation
*
* Use this macro to annotate a function whose result must be used.
*
* There are several cases where this is useful:
* - If a function has no side effects (or no useful side effects), such that
* the only useful purpose of calling said function is to obtain its
* return value.
* - If ignoring the function return value would lead to a resource leak
* (including but not limited to a memory leak).
* - If a function cannot be used correctly without checking its return value.
* For instance, if the function can fail at any time.
*
* The compiler may warn if the return value of a function call is ignored.
*/
# define VLC_USED
#endif
#if defined (__ELF__) || defined (__MACH__) || defined (__wasm__)
......
......@@ -631,6 +631,20 @@ VLC_API void *vlc_threadvar_get(vlc_threadvar_t);
VLC_API int vlc_clone(vlc_thread_t *th, void *(*entry)(void *),
void *data) VLC_USED;
#if defined(__GNUC__)
static
VLC_UNUSED_FUNC
VLC_WARN_CALL("thread name too big")
const char * vlc_thread_name_too_big( const char * thread_name )
{
return thread_name;
}
# define check_name_length( thread_name ) \
((__builtin_constant_p(strlen(thread_name) > 15)) ? \
vlc_thread_name_too_big(thread_name) : thread_name)
#endif
/**
* Set the thread name of the current thread.
*
......@@ -640,6 +654,9 @@ VLC_API int vlc_clone(vlc_thread_t *th, void *(*entry)(void *),
* nul character. If larger, the name will be truncated.
*/
VLC_API void vlc_thread_set_name(const char *name);
#if defined(check_name_length)
# define vlc_thread_set_name(name) vlc_thread_set_name(check_name_length(name))
#endif
/**
* Marks a thread as cancelled.
......@@ -765,16 +782,16 @@ VLC_API void vlc_tick_sleep(vlc_tick_t delay);
#define VLC_HARD_MIN_SLEEP VLC_TICK_FROM_MS(10) /* 10 milliseconds = 1 tick at 100Hz */
#define VLC_SOFT_MIN_SLEEP VLC_TICK_FROM_SEC(9) /* 9 seconds */
#if defined (__GNUC__) && !defined (__clang__)
#if defined(__GNUC__)
/* Linux has 100, 250, 300 or 1000Hz
*
* HZ=100 by default on FreeBSD, but some architectures use a 1000Hz timer
*/
static
__attribute__((unused))
__attribute__((noinline))
__attribute__((error("sorry, cannot sleep for such short a time")))
VLC_UNUSED_FUNC
VLC_ERROR_CALL("sorry, cannot sleep for such short a time")
vlc_tick_t impossible_delay( vlc_tick_t delay )
{
(void) delay;
......@@ -782,9 +799,8 @@ vlc_tick_t impossible_delay( vlc_tick_t delay )
}
static
__attribute__((unused))
__attribute__((noinline))
__attribute__((warning("use proper event handling instead of short delay")))
VLC_UNUSED_FUNC
VLC_WARN_CALL("use proper event handling instead of short delay")
vlc_tick_t harmful_delay( vlc_tick_t delay )
{
return delay;
......@@ -800,9 +816,8 @@ vlc_tick_t harmful_delay( vlc_tick_t delay )
: d))
static
__attribute__((unused))
__attribute__((noinline))
__attribute__((error("deadlines can not be constant")))
VLC_UNUSED_FUNC
VLC_ERROR_CALL("deadlines can not be constant")
vlc_tick_t impossible_deadline( vlc_tick_t deadline )
{
return deadline;
......@@ -810,13 +825,14 @@ vlc_tick_t impossible_deadline( vlc_tick_t deadline )
# define check_deadline( d ) \
(__builtin_constant_p(d) ? impossible_deadline(d) : d)
#else
# define check_delay(d) (d)
# define check_deadline(d) (d)
#endif
#if defined(check_delay)
#define vlc_tick_sleep(d) vlc_tick_sleep(check_delay(d))
#endif
#if defined(check_deadline)
#define vlc_tick_wait(d) vlc_tick_wait(check_deadline(d))
#endif
/**
* \defgroup timer Asynchronous/threaded timers
......
......@@ -25,7 +25,7 @@
#include <vlc_common.h>
#include <vlc_threads.h>
void vlc_thread_set_name(const char *name)
void (vlc_thread_set_name)(const char *name)
{
pthread_setname_np(name);
}
......@@ -45,7 +45,7 @@ unsigned long vlc_thread_id(void)
return tid;
}
void vlc_thread_set_name(const char *name)
void (vlc_thread_set_name)(const char *name)
{
pthread_set_name_np(pthread_self(), name);
}
......
......@@ -51,7 +51,7 @@ unsigned long vlc_thread_id(void)
return tid;
}
void vlc_thread_set_name(const char *name)
void (vlc_thread_set_name)(const char *name)
{
prctl(PR_SET_NAME, name);
}
......
......@@ -509,7 +509,7 @@ unsigned long vlc_thread_id (void)
return _gettid();
}
void vlc_thread_set_name(const char *name)
void (vlc_thread_set_name)(const char *name)
{
VLC_UNUSED(name);
}
......
......@@ -204,7 +204,7 @@ VLC_WEAK unsigned long vlc_thread_id(void)
return (uintptr_t)(void *)&dummy;
}
VLC_WEAK void vlc_thread_set_name(const char *name)
VLC_WEAK void (vlc_thread_set_name)(const char *name)
{
VLC_UNUSED(name);
}
......
......@@ -407,7 +407,7 @@ unsigned long vlc_thread_id (void)
return GetCurrentThreadId ();
}
void vlc_thread_set_name(const char *name)
void (vlc_thread_set_name)(const char *name)
{
if (SetThreadDescription_)
{
......