From: Juanma Barranquero Date: Wed, 26 Mar 2014 10:21:55 +0000 (+0100) Subject: src/*.c: Silence a few warnings about unused vars and functions. X-Git-Tag: emacs-25.0.90~2640^2~327 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5af73b0fe8975eeb47fb270819b4143c18d71caa;p=emacs.git src/*.c: Silence a few warnings about unused vars and functions. * src/image.c (x_bitmap_height, x_bitmap_width) [HAVE_X_WINDOWS]: * src/sysdep.c (reset_sigio) [!DOS_NT]: Declare conditionally. * src/keyboard.c (read_decoded_event_from_main_queue): #ifdef out variables on Windows. * src/w32.c (unsetenv): Remove unused var `retval'. (emacs_gnutls_pull): Remove unused vars `fdset' and `timeout'. * src/w32fns.c (Ffile_system_info): Use parenthesis in and/or expression. * src/w32notify.c (watch_worker): Remove unnecesary var sleep_result. (start_watching): Remove unused var `thr'. * src/w32proc.c (sys_spawnve): Comment out unused vars `first', `last'. (find_child_console): Remove unnecesary var `thread_id'. * src/w32term.c (w32_read_socket): Comment out unused vars `row', `columns'. (x_focus_frame): #ifdef 0 unused variable `dpyinfo'. --- diff --git a/src/ChangeLog b/src/ChangeLog index 05c5b42ef90..84cd041c36c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,25 @@ +2014-03-26 Juanma Barranquero + + * image.c (x_bitmap_height, x_bitmap_width) [HAVE_X_WINDOWS]: + * sysdep.c (reset_sigio) [!DOS_NT]: Declare conditionally. + + * keyboard.c (read_decoded_event_from_main_queue): #ifdef out + variables on Windows. + + * w32fns.c (Ffile_system_info): Use parenthesis in and/or expression. + + * w32.c (unsetenv): Remove unused var `retval'. + (emacs_gnutls_pull): Remove unused vars `fdset' and `timeout'. + + * w32notify.c (watch_worker): Remove unnecesary var sleep_result. + (start_watching): Remove unused var `thr'. + + * w32proc.c (sys_spawnve): Comment out unused vars `first', `last'. + (find_child_console): Remove unnecesary var `thread_id'. + + * w32term.c (w32_read_socket): Comment out unused vars `row', `columns'. + (x_focus_frame): #ifdef 0 unused variable `dpyinfo'. + 2014-03-26 Glenn Morris * filelock.c (Flock_buffer): Doc tweak. diff --git a/src/image.c b/src/image.c index d6d5ace509d..6b33e1de8a1 100644 --- a/src/image.c +++ b/src/image.c @@ -160,6 +160,7 @@ XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel) /* Functions to access the contents of a bitmap, given an id. */ +#ifdef HAVE_X_WINDOWS static int x_bitmap_height (struct frame *f, ptrdiff_t id) { @@ -171,6 +172,7 @@ x_bitmap_width (struct frame *f, ptrdiff_t id) { return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].width; } +#endif #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) ptrdiff_t diff --git a/src/keyboard.c b/src/keyboard.c index 2b3de6e27c2..439a40f8762 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2299,8 +2299,10 @@ read_decoded_event_from_main_queue (struct timespec *end_time, bool *used_mouse_menu) { #define MAX_ENCODED_BYTES 16 +#ifndef WINDOWSNT Lisp_Object events[MAX_ENCODED_BYTES]; int n = 0; +#endif while (true) { Lisp_Object nextevt diff --git a/src/sysdep.c b/src/sysdep.c index af9f4801cec..b33900062ae 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -603,6 +603,7 @@ init_sigio (int fd) #endif } +#ifndef DOS_NT static void reset_sigio (int fd) { @@ -610,6 +611,7 @@ reset_sigio (int fd) fcntl (fd, F_SETFL, old_fcntl_flags[fd]); #endif } +#endif void request_sigio (void) diff --git a/src/w32.c b/src/w32.c index 1ffb6ec171f..95092daa83a 100644 --- a/src/w32.c +++ b/src/w32.c @@ -2413,7 +2413,6 @@ unsetenv (const char *name) { char *var; size_t name_len; - int retval; if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) { @@ -9261,8 +9260,6 @@ ssize_t emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz) { int n, err; - SELECT_TYPE fdset; - struct timespec timeout; struct Lisp_Process *process = (struct Lisp_Process *)p; int fd = process->infd; diff --git a/src/w32fns.c b/src/w32fns.c index 9dab1408b49..080771f4cca 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7528,8 +7528,8 @@ If the underlying system call fails, value is nil. */) (char *, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER) = GetProcAddress (hKernel, "GetDiskFreeSpaceExA"); bool have_pfn_GetDiskFreeSpaceEx = - (w32_unicode_filenames && pfn_GetDiskFreeSpaceExW - || !w32_unicode_filenames && pfn_GetDiskFreeSpaceExA); + ((w32_unicode_filenames && pfn_GetDiskFreeSpaceExW) + || (!w32_unicode_filenames && pfn_GetDiskFreeSpaceExA)); /* On Windows, we may need to specify the root directory of the volume holding FILENAME. */ diff --git a/src/w32notify.c b/src/w32notify.c index 7155f16f3b0..86412b8a974 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -247,7 +247,6 @@ watch_worker (LPVOID arg) do { BOOL status; - DWORD sleep_result; DWORD bytes_ret = 0; if (dirwatch->dir) @@ -275,7 +274,7 @@ watch_worker (LPVOID arg) /* Sleep indefinitely until awoken by the I/O completion, which could be either a change notification or a cancellation of the watch. */ - sleep_result = SleepEx (INFINITE, TRUE); + SleepEx (INFINITE, TRUE); } while (!dirwatch->terminate); return 0; @@ -287,7 +286,6 @@ static struct notification * start_watching (const char *file, HANDLE hdir, BOOL subdirs, DWORD flags) { struct notification *dirwatch = xzalloc (sizeof (struct notification)); - HANDLE thr; dirwatch->signature = DIRWATCH_SIGNATURE; dirwatch->buf = xmalloc (16384); diff --git a/src/w32proc.c b/src/w32proc.c index 96f11657892..426a656f566 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1772,12 +1772,12 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) if (need_quotes) { int escape_char_run = 0; - char * first; - char * last; + /* char * first; */ + /* char * last; */ p = *targ; - first = p; - last = p + strlen (p) - 1; + /* first = p; */ + /* last = p + strlen (p) - 1; */ *parg++ = '"'; #if 0 /* This version does not escape quotes if they occur at the @@ -2249,10 +2249,9 @@ static BOOL CALLBACK find_child_console (HWND hwnd, LPARAM arg) { child_process * cp = (child_process *) arg; - DWORD thread_id; DWORD process_id; - thread_id = GetWindowThreadProcessId (hwnd, &process_id); + GetWindowThreadProcessId (hwnd, &process_id); if (process_id == cp->procinfo.dwProcessId) { char window_class[32]; diff --git a/src/w32term.c b/src/w32term.c index 15b502b7c1b..52eccc27e81 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4752,8 +4752,8 @@ w32_read_socket (struct terminal *terminal, width = rect.right - rect.left; text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width); text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height); - rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); - columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); + /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */ + /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */ /* TODO: Clip size to the screen dimensions. */ @@ -5794,7 +5794,9 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) void x_focus_frame (struct frame *f) { +#if 0 struct w32_display_info *dpyinfo = &one_w32_display_info; +#endif /* Give input focus to frame. */ block_input ();