Use __func__ instead of __FUNCTION__
PATCH 1/4 Use __func__ instead of __FUNCTION__
They are equivalent, but __func__ is in C99. __FUNCTION__ exists only for backwards compatibility with old gcc versions.
--- alsactl/alsactl.h | 16 ++++++++-------- aplay/aplay.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-)
alsactl/alsactl.h +8 -8
@@ -13,15 +13,15 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...);void dbg_ (const char *fcn,long line,const char *fmt, ...);#if __GNUC__ >2 || (__GNUC__ ==2 && __GNUC_MINOR__ >=95 ) -#define info (...) do { info_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) -#define error (...) do { error_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) -#define cerror (cond, ...) do { cerror_(__FUNCTION__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0) -#define dbg (...) do { dbg_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) +#define info (...) do { info_(__func__, __LINE__, __VA_ARGS__); } while (0) +#define error (...) do { error_(__func__, __LINE__, __VA_ARGS__); } while (0) +#define cerror (cond, ...) do { cerror_(__func__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0) +#define dbg (...) do { dbg_(__func__, __LINE__, __VA_ARGS__); } while (0)#else -#define info(args...) do { info_(__FUNCTION__, __LINE__, ##args); } while (0) -#define error(args...) do { error_(__FUNCTION__, __LINE__, ##args); } while (0) -#define cerror (cond, ...) do { error_(__FUNCTION__, __LINE__, (cond) != 0, ##args); } while (0) -#define dbg(args...) do { dbg_(__FUNCTION__, __LINE__, ##args); } while (0) +#define info(args...) do { info_(__func__, __LINE__, ##args); } while (0) +#define error(args...) do { error_(__func__, __LINE__, ##args); } while (0) +#define cerror (cond, ...) do { error_(__func__, __LINE__, (cond) != 0, ##args); } while (0) +#define dbg(args...) do { dbg_(__func__, __LINE__, ##args); } while (0)#endif int init (const char *file,const char *cardname);
aplay/aplay.c +2 -2
@@ -186,13 +186,13 @@ static const struct fmt_capture {#if __GNUC__ >2 || (__GNUC__ ==2 && __GNUC_MINOR__ >=95 )#define error (...) do {\ - fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \ + fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \ fprintf(stderr, __VA_ARGS__); \ putc('\n', stderr); \ } while (0)#else #define error(args...) do {\ - fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \ + fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \ fprintf(stderr, ##args); \ putc('\n', stderr); \ } while (0)
Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/4 Avoid pointer arithmetic on `void *`
The pointer operand to the binary + operator must be to a complete object type.
--- aplay/aplay.c | 4 ++-- axfer/xfer-libasound-irq-mmap.c | 7 ++++--- axfer/xfer-libasound-timer-mmap.c | 4 ++-- bat/common.c | 2 +- seq/aplaymidi/aplaymidi.c | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-)
aplay/aplay.c +2 -2
@@ -442,7 +442,7 @@ static ssize_t xwrite(int fd, const void *buf, size_t count)size_t offset =0 ;while (offset < count) { - written =write (fd, buf + offset, count - offset); + written =write (fd, (char *)buf + offset, count - offset);if (written <=0 )return written;
@@ -1210,7 +1210,7 @@ static int test_au(int fd, void *buffer) hwparams.channels =BE_INT (ap->channels);if (hwparams.channels <1 || hwparams.channels >256 )return -1 ; -if ((size_t )safe_read (fd, buffer +sizeof (AuHeader),BE_INT (ap->hdr_size) -sizeof (AuHeader)) !=BE_INT (ap->hdr_size) -sizeof (AuHeader)) { +if ((size_t )safe_read (fd, (char *)buffer +sizeof (AuHeader),BE_INT (ap->hdr_size) -sizeof (AuHeader)) !=BE_INT (ap->hdr_size) -sizeof (AuHeader)) {error (_ ("read error" ));prg_exit (EXIT_FAILURE ); }
axfer/xfer-libasound-irq-mmap.c +4 -3
@@ -146,9 +146,10 @@ static int irq_mmap_process_frames(struct libasound_state *state,// TODO: Perhaps, the complex layout can be supported as a variation of // vector type. However, there's no driver with this layout. if (layout->vector ==NULL ) { - frame_buf = areas[0 ].addr; - frame_buf +=snd_pcm_frames_to_bytes (state->handle, - frame_offset); +char *buf; + buf = areas[0 ].addr; + buf +=snd_pcm_frames_to_bytes (state->handle, frame_offset); + frame_buf = buf; }else {int i;for (i =0 ; i < layout->samples_per_frame; ++i) {
axfer/xfer-libasound-timer-mmap.c +2 -2
@@ -100,8 +100,8 @@ static void *get_buffer(struct libasound_state *state,if (layout->vector ==NULL ) {char *buf; - buf = areas[0 ].addr +snd_pcm_frames_to_bytes (state->handle, - frame_offset); + buf = areas[0 ].addr; + buf +=snd_pcm_frames_to_bytes (state->handle, frame_offset); frame_buf = buf; }else {int i;
bat/common.c +1 -1
@@ -231,7 +231,7 @@ int generate_input_data(struct bat *bat, void *buffer, int bytes, int frames) load =0 ;while (1 ) { - err =fread (buffer + load,1 , bytes - load, bat->fp); + err =fread ((char *)buffer + load,1 , bytes - load, bat->fp);if (0 == err) {if (feof (bat->fp)) { fprintf(bat->log,
seq/aplaymidi/aplaymidi.c +1 -1
@@ -633,7 +633,7 @@ static void handle_big_sysex(snd_seq_event_t *ev)check_snd ("sync output" , err);if (sleep (1 ))fatal ("aborted" ); - ev->data.ext.ptr +=MIDI_BYTES_PER_SEC ; + ev->data.ext.ptr = (char *)ev->data.ext.ptr +MIDI_BYTES_PER_SEC ; length -=MIDI_BYTES_PER_SEC ; } ev->data.ext.len = length;
Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [alsa-devel] [PATCH alsa-utils 2/4] Avoid pointer arithmetic on `void *`
Quoted 11 lines · Michael Forney
The pointer operand to the binary
+operator must be to a complete object type.Signed-off-by Michael Forney <[email protected]>--- aplay/aplay.c | 4 ++-- axfer/xfer-libasound-irq-mmap.c | 7 ++++--- axfer/xfer-libasound-timer-mmap.c | 4 ++-- bat/common.c | 2 +- seq/aplaymidi/aplaymidi.c | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-)
These changes look good to me.
Quoted 88 lines
aplay/aplay.c +2
-2@@ -442,7 +442,7 @@ static ssize_t xwrite(int fd, const void *buf, size_t count)size_t offset =0 ;while (offset < count) { - written =write (fd, buf + offset, count - offset); + written =write (fd, (char *)buf + offset, count - offset);if (written <=0 )return written;@@ -1210,7 +1210,7 @@ static int test_au(int fd, void *buffer) hwparams.channels =BE_INT (ap->channels);if (hwparams.channels <1 || hwparams.channels >256 )return -1 ; -if ((size_t )safe_read (fd, buffer +sizeof (AuHeader),BE_INT (ap->hdr_size) -sizeof (AuHeader)) !=BE_INT (ap->hdr_size) -sizeof (AuHeader)) { +if ((size_t )safe_read (fd, (char *)buffer +sizeof (AuHeader),BE_INT (ap->hdr_size) -sizeof (AuHeader)) !=BE_INT (ap->hdr_size) -sizeof (AuHeader)) {error (_ ("read error" ));prg_exit (EXIT_FAILURE ); }axfer/xfer-libasound-irq-mmap.c +4
-3@@ -146,9 +146,10 @@ static int irq_mmap_process_frames(struct libasound_state *state,// TODO: Perhaps, the complex layout can be supported as a variation of // vector type. However, there's no driver with this layout. if (layout->vector ==NULL ) { - frame_buf = areas[0 ].addr; - frame_buf +=snd_pcm_frames_to_bytes (state->handle, - frame_offset); +char *buf; + buf = areas[0 ].addr; + buf +=snd_pcm_frames_to_bytes (state->handle, frame_offset); + frame_buf = buf; }else {int i;for (i =0 ; i < layout->samples_per_frame; ++i) {axfer/xfer-libasound-timer-mmap.c +2
-2@@ -100,8 +100,8 @@ static void *get_buffer(struct libasound_state *state,if (layout->vector ==NULL ) {char *buf; - buf = areas[0 ].addr +snd_pcm_frames_to_bytes (state->handle, - frame_offset); + buf = areas[0 ].addr; + buf +=snd_pcm_frames_to_bytes (state->handle, frame_offset); frame_buf = buf; }else {int i;bat/common.c +1
-1@@ -231,7 +231,7 @@ int generate_input_data(struct bat *bat, void *buffer, int bytes, int frames) load =0 ;while (1 ) { - err =fread (buffer + load,1 , bytes - load, bat->fp); + err =fread ((char *)buffer + load,1 , bytes - load, bat->fp);if (0 == err) {if (feof (bat->fp)) { fprintf(bat->log,seq/aplaymidi/aplaymidi.c +1
-1@@ -633,7 +633,7 @@ static void handle_big_sysex(snd_seq_event_t *ev)check_snd ("sync output" , err);if (sleep (1 ))fatal ("aborted" ); - ev->data.ext.ptr +=MIDI_BYTES_PER_SEC ; + ev->data.ext.ptr = (char *)ev->data.ext.ptr +MIDI_BYTES_PER_SEC ; length -=MIDI_BYTES_PER_SEC ; } ev->data.ext.len = length;Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [alsa-devel] [PATCH alsa-utils 2/4] Avoid pointer arithmetic on `void *`
In reply to Michael ForneyQuoted 2 lines · Michael Forney
The pointer operand to the binary
+operator must be to a complete object type.
Why are you making this change? Are you trying to compile alsa-utils with MSVC?
Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [alsa-devel] [PATCH alsa-utils 2/4] Avoid pointer arithmetic on `void *`
Quoted 6 lines · Clemens Ladisch
Quoted 2 lines · Michael Forney
The pointer operand to the binary
+operator must be to a complete object type.Why are you making this change? Are you trying to compile alsa-utils with MSVC?
I'm trying to compile alsa-utils with cproc[0], which is my C compiler project.
[0] https://git.sr.ht/~mcf/cproc
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 3/4 Use %lli for long long in printf
In reply to Michael ForneyThe L length modifier only applies to floating-point conversion specifiers, and ll is used for long long integers.
Although glibc accepts %Li, musl does not and returns EINVAL.
--- alsactl/state.c | 4 ++-- amixer/amixer.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
alsactl/state.c +2 -2
@@ -336,9 +336,9 @@ static int get_control(snd_ctl_t *handle, snd_ctl_elem_id_t *id, snd_config_t *tlong long max =snd_ctl_elem_info_get_max64 (info);long long step =snd_ctl_elem_info_get_step64 (info);if (step) -sprintf (buf,"%Li - %Li (step %Li)" , min, max, step); +sprintf (buf,"%lli - %lli (step %lli)" , min, max, step);else -sprintf (buf,"%Li - %Li" , min, max); +sprintf (buf,"%lli - %lli" , min, max); err =snd_config_string_add (comment,"range" , buf);if (err <0 ) {error ("snd_config_string_add: %s" ,snd_strerror (err));
amixer/amixer.c +2 -2
@@ -620,7 +620,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem, snd_ctl_elem_info_get_step(info));break ;case SND_CTL_ELEM_TYPE_INTEGER64 : -printf (",min=%Li,max=%Li,step=%Li\n" , +printf (",min=%lli,max=%lli,step=%lli\n" ,snd_ctl_elem_info_get_min64 (info),snd_ctl_elem_info_get_max64 (info),snd_ctl_elem_info_get_step64 (info));
@@ -662,7 +662,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,printf ("%li" ,snd_ctl_elem_value_get_integer (control, idx));break ;case SND_CTL_ELEM_TYPE_INTEGER64 : -printf ("%Li" ,snd_ctl_elem_value_get_integer64 (control, idx)); +printf ("%lli" ,snd_ctl_elem_value_get_integer64 (control, idx));break ;case SND_CTL_ELEM_TYPE_ENUMERATED :printf ("%u" ,snd_ctl_elem_value_get_enumerated (control, idx));
Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [alsa-devel] [PATCH alsa-utils 3/4] Use %lli for long long in printf
Quoted 10 lines · Michael Forney
The
Llength modifier only applies to floating-point conversion specifiers, andllis used forlong longintegers.Although glibc accepts %Li, musl does not and returns EINVAL.
Signed-off-by Michael Forney <[email protected]>--- alsactl/state.c | 4 ++-- amixer/amixer.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Looks good to me.
Quoted 45 lines
alsactl/state.c +2
-2@@ -336,9 +336,9 @@ static int get_control(snd_ctl_t *handle, snd_ctl_elem_id_t *id, snd_config_t *tlong long max =snd_ctl_elem_info_get_max64 (info);long long step =snd_ctl_elem_info_get_step64 (info);if (step) -sprintf (buf,"%Li - %Li (step %Li)" , min, max, step); +sprintf (buf,"%lli - %lli (step %lli)" , min, max, step);else -sprintf (buf,"%Li - %Li" , min, max); +sprintf (buf,"%lli - %lli" , min, max); err =snd_config_string_add (comment,"range" , buf);if (err <0 ) {error ("snd_config_string_add: %s" ,snd_strerror (err));amixer/amixer.c +2
-2@@ -620,7 +620,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem, snd_ctl_elem_info_get_step(info));break ;case SND_CTL_ELEM_TYPE_INTEGER64 : -printf (",min=%Li,max=%Li,step=%Li\n" , +printf (",min=%lli,max=%lli,step=%lli\n" ,snd_ctl_elem_info_get_min64 (info),snd_ctl_elem_info_get_max64 (info),snd_ctl_elem_info_get_step64 (info));@@ -662,7 +662,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,printf ("%li" ,snd_ctl_elem_value_get_integer (control, idx));break ;case SND_CTL_ELEM_TYPE_INTEGER64 : -printf ("%Li" ,snd_ctl_elem_value_get_integer64 (control, idx)); +printf ("%lli" ,snd_ctl_elem_value_get_integer64 (control, idx));break ;case SND_CTL_ELEM_TYPE_ENUMERATED :printf ("%u" ,snd_ctl_elem_value_get_enumerated (control, idx));Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 4/4 Avoid empty initializer list
In reply to Michael ForneyTo zero-initialize an object, use {0} instead.
--- alsamixer/cli.c | 2 +- amidi/amidi.c | 2 +- seq/aplaymidi/aplaymidi.c | 2 +- seq/aplaymidi/arecordmidi.c | 2 +- seq/aseqdump/aseqdump.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
alsamixer/cli.c +1 -1
@@ -58,7 +58,7 @@ static void parse_options(int argc, char *argv[]) { .name = "view", .has_arg = 1, .val = 'V' }, { .name = "no-color", .val = 'g' }, { .name = "abstraction", .has_arg = 1, .val = 'a' }, - { } + { 0 } };int option;int card_index;
amidi/amidi.c +1 -1
@@ -469,7 +469,7 @@ int main(int argc, char *argv[]) {"active-sensing", 0, NULL, 'a'}, {"clock", 0, NULL, 'c'}, {"sysex-interval", 1, NULL, 'i'}, - { } + {0} };int c, err, ok =0 ;int ignore_active_sensing =1 ;
seq/aplaymidi/aplaymidi.c +1 -1
@@ -869,7 +869,7 @@ int main(int argc, char *argv[]) {"list", 0, NULL, 'l'}, {"port", 1, NULL, 'p'}, {"delay", 1, NULL, 'd'}, - {} + {0} };int c;int do_list =0 ;
seq/aplaymidi/arecordmidi.c +1 -1
@@ -740,7 +740,7 @@ int main(int argc, char *argv[]) {"metronome", 1, NULL, 'm'}, {"timesig", 1, NULL, 'i'}, {"num-events", 1, NULL, 'n'}, - { } + {0} };char *filename =NULL ;
seq/aseqdump/aseqdump.c +1 -1
@@ -357,7 +357,7 @@ int main(int argc, char *argv[]) {"version", 0, NULL, 'V'}, {"list", 0, NULL, 'l'}, {"port", 1, NULL, 'p'}, - { } + {0} };int do_list =0 ;
Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [alsa-devel] [PATCH alsa-utils 4/4] Avoid empty initializer list
Quoted 10 lines · Michael Forney
To zero-initialize an object, use
{0}instead.Signed-off-by Michael Forney <[email protected]>--- alsamixer/cli.c | 2 +- amidi/amidi.c | 2 +- seq/aplaymidi/aplaymidi.c | 2 +- seq/aplaymidi/arecordmidi.c | 2 +- seq/aseqdump/aseqdump.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
Good to me.
I think it better for you to generate cover-letter (--cover-letter option for git-send-email) when posting a batch of patches.
Quoted 72 lines
alsamixer/cli.c +1
-1@@ -58,7 +58,7 @@ static void parse_options(int argc, char *argv[]) { .name = "view", .has_arg = 1, .val = 'V' }, { .name = "no-color", .val = 'g' }, { .name = "abstraction", .has_arg = 1, .val = 'a' }, - { } + { 0 } };int option;int card_index;amidi/amidi.c +1
-1@@ -469,7 +469,7 @@ int main(int argc, char *argv[]) {"active-sensing", 0, NULL, 'a'}, {"clock", 0, NULL, 'c'}, {"sysex-interval", 1, NULL, 'i'}, - { } + {0} };int c, err, ok =0 ;int ignore_active_sensing =1 ;seq/aplaymidi/aplaymidi.c +1
-1@@ -869,7 +869,7 @@ int main(int argc, char *argv[]) {"list", 0, NULL, 'l'}, {"port", 1, NULL, 'p'}, {"delay", 1, NULL, 'd'}, - {} + {0} };int c;int do_list =0 ;seq/aplaymidi/arecordmidi.c +1
-1@@ -740,7 +740,7 @@ int main(int argc, char *argv[]) {"metronome", 1, NULL, 'm'}, {"timesig", 1, NULL, 'i'}, {"num-events", 1, NULL, 'n'}, - { } + {0} };char *filename =NULL ;seq/aseqdump/aseqdump.c +1
-1@@ -357,7 +357,7 @@ int main(int argc, char *argv[]) {"version", 0, NULL, 'V'}, {"list", 0, NULL, 'l'}, {"port", 1, NULL, 'p'}, - { } + {0} };int do_list =0 ;Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [alsa-devel] [PATCH alsa-utils 4/4] Avoid empty initializer list
Quoted 1 line · Takashi Sakamoto
Good to me.
Thanks for reviewing.
Quoted 2 lines
I think it better for you to generate cover-letter (--cover-letter option for git-send-email) when posting a batch of patches.
Sorry about that. I'll make sure to add a cover letter next time.
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [alsa-devel] [PATCH alsa-utils 4/4] Avoid empty initializer list
Quoted 9 lines · Michael Forney
Quoted 1 line · Takashi Sakamoto
Good to me.
Thanks for reviewing.
Quoted 2 lines
I think it better for you to generate cover-letter (--cover-letter option for git-send-email) when posting a batch of patches.
Sorry about that. I'll make sure to add a cover letter next time.
Oops. It's an option for 'git-format-patch' command... I'd like to correct it, sorry.
Regards
Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 4 lines · Michael Forney
They are equivalent, but
__func__is in C99.__FUNCTION__exists only for backwards compatibility with old gcc versions.Signed-off-by Michael Forney <[email protected]>
For out information:
https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html
Quoted 60 lines
--- alsactl/alsactl.h | 16 ++++++++-------- aplay/aplay.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-)alsactl/alsactl.h +8
-8@@ -13,15 +13,15 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...);void dbg_ (const char *fcn,long line,const char *fmt, ...);#if __GNUC__ >2 || (__GNUC__ ==2 && __GNUC_MINOR__ >=95 ) -#define info (...) do { info_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) -#define error (...) do { error_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) -#define cerror (cond, ...) do { cerror_(__FUNCTION__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0) -#define dbg (...) do { dbg_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) +#define info (...) do { info_(__func__, __LINE__, __VA_ARGS__); } while (0) +#define error (...) do { error_(__func__, __LINE__, __VA_ARGS__); } while (0) +#define cerror (cond, ...) do { cerror_(__func__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0) +#define dbg (...) do { dbg_(__func__, __LINE__, __VA_ARGS__); } while (0)#else -#define info(args...) do { info_(__FUNCTION__, __LINE__, ##args); } while (0) -#define error(args...) do { error_(__FUNCTION__, __LINE__, ##args); } while (0) -#define cerror (cond, ...) do { error_(__FUNCTION__, __LINE__, (cond) != 0, ##args); } while (0) -#define dbg(args...) do { dbg_(__FUNCTION__, __LINE__, ##args); } while (0) +#define info(args...) do { info_(__func__, __LINE__, ##args); } while (0) +#define error(args...) do { error_(__func__, __LINE__, ##args); } while (0) +#define cerror (cond, ...) do { error_(__func__, __LINE__, (cond) != 0, ##args); } while (0) +#define dbg(args...) do { dbg_(__func__, __LINE__, ##args); } while (0)#endif int init (const char *file,const char *cardname);aplay/aplay.c +2
-2@@ -186,13 +186,13 @@ static const struct fmt_capture {#if __GNUC__ >2 || (__GNUC__ ==2 && __GNUC_MINOR__ >=95 )#define error (...) do {\ - fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \ + fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \ fprintf(stderr, __VA_ARGS__); \ putc('\n', stderr); \ } while (0)#else #define error(args...) do {\ - fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \ + fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \ fprintf(stderr, ##args); \ putc('\n', stderr); \ } while (0)Signature · 6 lines
2.25.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel