From f76158def792b30973d21fd95aed52e96039532b Mon Sep 17 00:00:00 2001 From: Nelson Ferreira Date: Sun, 6 Dec 2015 16:02:46 -0500 Subject: [PATCH] Shut set but unused warnings. These are in the code for debug/inspection purposes. * src/ui/lwlib/xlwgauge.c (GaugeExpose): Use SXE_SET_UNUSED. * src/ui/lwlib/xlwcheckbox.c (DrawCheck):Ditto. * src/sysdep.c (tty_init_sys_modes_on_device) (tty_reset_sys_modes_on_device): Ditto. * src/regex.c (re_match_2_internal): Ditto. * src/mule/file-coding.c (Fdefine_coding_system_alias): Ditto. * src/media/sound-oss.c (sound_oss_handle_aj_events): Ditto. * src/media/sound-jack.c (sound_jack_handle_aj_events) (sound_jack_process): Ditto. * src/media/sound-ao.c (sound_ao_handle_aj_events): Ditto. * src/media/sound-alsa.c (sound_alsa_handle_aj_events): Ditto. * src/media/media-sndfile.c (media_sndfile_open): Ditto. * src/media/media-mad.c (media_mad_read): Ditto. * src/media/media-internal.c (media_internal_analyse_stream): Ditto. * src/emacs.c (Fdump_emacs): Ditto. * src/bytecode.c (execute_optimized_program): Ditto. Signed-off-by: Nelson Ferreira --- src/bytecode.c | 2 ++ src/emacs.c | 1 + src/media/media-internal.c | 2 ++ src/media/media-mad.c | 1 + src/media/media-sndfile.c | 2 ++ src/media/sound-alsa.c | 2 ++ src/media/sound-ao.c | 2 ++ src/media/sound-jack.c | 5 +++++ src/media/sound-oss.c | 2 ++ src/mule/file-coding.c | 1 + src/regex.c | 3 +++ src/sysdep.c | 2 ++ src/ui/lwlib/xlwcheckbox.c | 3 +++ src/ui/lwlib/xlwgauge.c | 2 ++ 14 files changed, 30 insertions(+) diff --git a/src/bytecode.c b/src/bytecode.c index 8157c82..8eb8186 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1049,6 +1049,8 @@ execute_optimized_program(const Opbyte *program, Lisp_Object args; orig_fun = fun = XCAR(op); + SXE_SET_UNUSED(orig_fun); + args = XCDR(op); if (SYMBOLP (fun) && !EQ(fun, Qunbound) && (fun = XSYMBOL(fun)->function, SYMBOLP(fun))) diff --git a/src/emacs.c b/src/emacs.c index 8feec5d..04f9664 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -3064,6 +3064,7 @@ and announce itself normally when it is run. garbage_collect_1(); #ifdef PDUMP + SXE_SET_UNUSED(symfile_ext); pdump(filename_ext); #else diff --git a/src/media/media-internal.c b/src/media/media-internal.c index e59193c..7ee8deb 100644 --- a/src/media/media-internal.c +++ b/src/media/media-internal.c @@ -947,6 +947,8 @@ void media_internal_analyse_stream(Lisp_Media_Stream *ms) mkfp = media_stream_kind_properties(ms).fprops; TO_EXTERNAL_FORMAT(LISP_STRING, mkfp->filename, ALLOCA, (file, file_len), Qnil); + SXE_SET_UNUSED(file_len); + if (file == NULL || (fd = open(file, O_RDONLY, 0)) < 0) { xfree(data); return; diff --git a/src/media/media-mad.c b/src/media/media-mad.c index ba2101c..58ff625 100644 --- a/src/media/media-mad.c +++ b/src/media/media-mad.c @@ -299,6 +299,7 @@ media_mad_read(media_substream *mss, void *outbuf, size_t length) /* fetch framesize */ framesize = mtap->framesize; + SXE_SET_UNUSED(framesize); /* prepare mad */ mads = madd->stream; diff --git a/src/media/media-sndfile.c b/src/media/media-sndfile.c index e819126..05dc2e0 100644 --- a/src/media/media-sndfile.c +++ b/src/media/media-sndfile.c @@ -105,6 +105,8 @@ media_sndfile_open(Lisp_Media_Stream *ms) mkfp = media_stream_kind_properties(ms).fprops; TO_EXTERNAL_FORMAT(LISP_STRING, mkfp->filename, ALLOCA, (file, file_len), Qnil); + SXE_SET_UNUSED(file_len); + if ( file != NULL ) { sf = sf_open(file, SFM_READ, sfinfo); } diff --git a/src/media/sound-alsa.c b/src/media/sound-alsa.c index c887ef0..1428f1e 100644 --- a/src/media/sound-alsa.c +++ b/src/media/sound-alsa.c @@ -275,6 +275,8 @@ sound_alsa_handle_aj_events(audio_job_t aj) SXE_MUTEX_LOCK(&aj->mtx); sasd = audio_job_device_data(aj); + SXE_SET_UNUSED(sasd); + if ((ev = eq_noseeum_dequeue(audio_job_queue(aj))) == NULL) { SXE_MUTEX_UNLOCK(&aj->mtx); return; diff --git a/src/media/sound-ao.c b/src/media/sound-ao.c index eb6ad12..1a4e2cd 100644 --- a/src/media/sound-ao.c +++ b/src/media/sound-ao.c @@ -253,6 +253,8 @@ sound_ao_handle_aj_events(audio_job_t aj) SXE_MUTEX_LOCK(&aj->mtx); sasd = audio_job_device_data(aj); + SXE_SET_UNUSED(sasd); + if ((ev = eq_noseeum_dequeue(audio_job_queue(aj))) == NULL) { SXE_MUTEX_UNLOCK(&aj->mtx); return; diff --git a/src/media/sound-jack.c b/src/media/sound-jack.c index 9fd116a..3cd1194 100644 --- a/src/media/sound-jack.c +++ b/src/media/sound-jack.c @@ -446,6 +446,8 @@ sound_jack_handle_aj_events(audio_job_t aj) SXE_MUTEX_LOCK(&aj->mtx); sasd = audio_job_device_data(aj); + SXE_SET_UNUSED(sasd); + if ((ev = eq_noseeum_dequeue(audio_job_queue(aj))) == NULL) { SXE_MUTEX_UNLOCK(&aj->mtx); return; @@ -495,8 +497,11 @@ sound_jack_process(jack_nframes_t nframes, void *userdata) aj = userdata; SXE_MUTEX_LOCK(&aj->mtx); mss = aj->substream; + SXE_SET_UNUSED(mss); + sjsd = audio_job_device_data(aj); buffer = aj->buffer; + SXE_SET_UNUSED(buffer); #ifdef EF_USE_ASYNEQ /* stuff on the event queue? */ diff --git a/src/media/sound-oss.c b/src/media/sound-oss.c index 253a391..42014ba 100644 --- a/src/media/sound-oss.c +++ b/src/media/sound-oss.c @@ -363,6 +363,8 @@ sound_oss_handle_aj_events(audio_job_t aj) SXE_MUTEX_LOCK(&aj->mtx); sasd = audio_job_device_data(aj); + SXE_SET_UNUSED(sasd); + if ((ev = eq_noseeum_dequeue(audio_job_queue(aj))) == NULL) { SXE_MUTEX_UNLOCK(&aj->mtx); return; diff --git a/src/mule/file-coding.c b/src/mule/file-coding.c index 90b7dc7..ce640a1 100644 --- a/src/mule/file-coding.c +++ b/src/mule/file-coding.c @@ -1228,6 +1228,7 @@ and `coding-system-canonical-name-p'. /* Checks that aliasee names a coding-system */ real_coding_system = Fget_coding_system(aliasee); + SXE_SET_UNUSED(real_coding_system); /* Check for coding system alias loops */ if (EQ(alias, aliasee)) diff --git a/src/regex.c b/src/regex.c index 6f9fb9c..2f7f8be 100644 --- a/src/regex.c +++ b/src/regex.c @@ -83,6 +83,8 @@ along with this program. If not, see . */ # undef REL_ALLOC #endif +#include "sxe-utils.h" + /* The `emacs' switch turns on certain matching commands that make sense only in Emacs. */ #ifdef emacs @@ -5855,6 +5857,7 @@ re_match_2_internal(struct re_pattern_buffer *bufp, re_char * string1, dummy_low_reg, dummy_high_reg, reg_dummy, reg_dummy, reg_info_dummy); + SXE_SET_UNUSED(pdummy), SXE_SET_UNUSED(sdummy); } /* Note fall through. */ diff --git a/src/sysdep.c b/src/sysdep.c index 7ffad2f..0828973 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1371,6 +1371,7 @@ static void tty_init_sys_modes_on_device(struct device *d) input_fd = CONSOLE_TTY_DATA(con)->infd; output_fd = CONSOLE_TTY_DATA(con)->outfd; + SXE_SET_UNUSED(output_fd); emacs_get_tty(input_fd, &CONSOLE_TTY_DATA(con)->old_tty); tty = CONSOLE_TTY_DATA(con)->old_tty; @@ -1725,6 +1726,7 @@ static void tty_reset_sys_modes_on_device(struct device *d) input_fd = CONSOLE_TTY_DATA(con)->infd; output_fd = CONSOLE_TTY_DATA(con)->outfd; + SXE_SET_UNUSED(output_fd); #if defined (IBMR2AIX) && defined (AIXHFT) { diff --git a/src/ui/lwlib/xlwcheckbox.c b/src/ui/lwlib/xlwcheckbox.c index 758799a..56b5b75 100644 --- a/src/ui/lwlib/xlwcheckbox.c +++ b/src/ui/lwlib/xlwcheckbox.c @@ -39,6 +39,8 @@ along with this program. If not, see . */ #include "ui/X11/xmu.h" #include "xlwcheckboxP.h" +#include "sxe-utils.h" + /* by using the same size for the checkbox as for the diamond box, * we can let the Radio widget do the vast majority of the work. */ @@ -392,6 +394,7 @@ static void DrawCheck(Widget w) pts[5].y = -s; XFillPolygon(dpy, win, bot, pts, 6, Nonconvex, CoordModePrevious); #else + SXE_SET_UNUSED(bw); XDrawRectangle(dpy, win, gc, bx + s, by + s, bsz, bsz); #endif diff --git a/src/ui/lwlib/xlwgauge.c b/src/ui/lwlib/xlwgauge.c index 07dbebc..4e1e5ec 100644 --- a/src/ui/lwlib/xlwgauge.c +++ b/src/ui/lwlib/xlwgauge.c @@ -380,6 +380,8 @@ static void GaugeExpose(Widget w, XEvent * event, Region region) hgt = gw->core.width; } + SXE_SET_UNUSED(hgt); + /* if the gauge is selected, signify by drawing the background * in a contrasting color. */ -- 2.25.1