From 84c53436ab25b6c8f76c133e59b34e533ea33cc7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 5 Nov 2016 20:41:37 -0700 Subject: Prefer comments /* like this */ in C code Emacs C code assumes C99 features, but has long used traditional comments /* like this */ instead of C99-style comments // like this. Stick with traditional comments for now, partly for style, partly as it may be safer with compilers that are not fully in C99 mode. --- src/emacs-module.c | 6 +++--- src/gfilenotify.c | 2 +- src/gtkutil.c | 2 +- src/image.c | 4 ++-- src/kqueue.c | 2 -- src/w32fns.c | 2 +- src/xdisp.c | 2 +- src/xselect.c | 7 ++++--- src/xsmfns.c | 2 +- src/xterm.c | 2 +- 10 files changed, 15 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/emacs-module.c b/src/emacs-module.c index eca5af739b9..a28fe57b12d 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -142,8 +142,8 @@ static emacs_value const module_nil = 0; or a pointer to handle non-local exits. The function must have an ENV parameter. The function will return the specified value if a signal or throw is caught. */ -// TODO: Have Fsignal check for CATCHER_ALL so we only have to install -// one handler. +/* TODO: Have Fsignal check for CATCHER_ALL so we only have to install + one handler. */ #define MODULE_HANDLE_NONLOCAL_EXIT(retval) \ MODULE_SETJMP (CONDITION_CASE, module_handle_signal, retval); \ MODULE_SETJMP (CATCHER_ALL, module_handle_throw, retval) @@ -163,7 +163,7 @@ static emacs_value const module_nil = 0; code after the macro may longjmp back into the macro, which means its local variable C must stay live in later code. */ -// TODO: Make backtraces work if this macros is used. +/* TODO: Make backtraces work if this macros is used. */ #define MODULE_SETJMP_1(handlertype, handlerfunc, retval, c, dummy) \ if (module_non_local_exit_check (env) != emacs_funcall_exit_return) \ diff --git a/src/gfilenotify.c b/src/gfilenotify.c index 3b1f2fc516a..30d0753f7e7 100644 --- a/src/gfilenotify.c +++ b/src/gfilenotify.c @@ -105,7 +105,7 @@ dir_monitor_callback (GFileMonitor *monitor, /* Store it into the input event queue. */ kbd_buffer_store_event (&event); - // XD_DEBUG_MESSAGE ("%s", XD_OBJECT_TO_STRING (event.arg)); + /* XD_DEBUG_MESSAGE ("%s", XD_OBJECT_TO_STRING (event.arg)); */ } /* Cancel monitor if file or directory is deleted. */ diff --git a/src/gtkutil.c b/src/gtkutil.c index e791e6ac317..0f256c563dc 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -185,7 +185,7 @@ xg_display_open (char *display_name, Display **dpy) { GdkDisplay *gdpy; - unrequest_sigio (); // See comment in x_display_ok, xterm.c. + unrequest_sigio (); /* See comment in x_display_ok, xterm.c. */ gdpy = gdk_display_open (display_name); request_sigio (); if (!gdpy_def && gdpy) diff --git a/src/image.c b/src/image.c index 78539d91d2b..6a62235673a 100644 --- a/src/image.c +++ b/src/image.c @@ -3712,7 +3712,7 @@ xpm_load (struct frame *f, struct image *img) } #ifdef USE_CAIRO - // Load very specific Xpm:s. + /* Load very specific Xpm:s. */ if (rc == XpmSuccess && img->ximg->format == ZPixmap && img->ximg->bits_per_pixel == 32 @@ -3736,7 +3736,7 @@ xpm_load (struct frame *f, struct image *img) int maskidx = mid ? i * img->mask_img->bytes_per_line + k/8 : 0; int mask = mid ? mid[maskidx] & (1 << (k % 8)) : 1; - if (mask) od[idx] = id[idx] + 0xff000000; // ff => full alpha + if (mask) od[idx] = id[idx] + 0xff000000; /* ff => full alpha */ else od[idx] = bgcolor; } } diff --git a/src/kqueue.c b/src/kqueue.c index c848b7ff1af..49ca0c95e27 100644 --- a/src/kqueue.c +++ b/src/kqueue.c @@ -264,8 +264,6 @@ kqueue_compare_dir_list (Lisp_Object watch_object) report_file_error ("New list not empty", new_dl); if (! NILP (pending_dl)) report_file_error ("Pending events list not empty", pending_dl); - // if (! NILP (deleted_dl)) - // report_file_error ("Deleted events list not empty", deleted_dl); /* Replace old directory listing with the new one. */ XSETCDR (Fnthcdr (make_number (3), watch_object), diff --git a/src/w32fns.c b/src/w32fns.c index c57b5a188b2..27c0d65fbd0 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6934,7 +6934,7 @@ value of DIR as in previous invocations; this is standard Windows behavior. */) } new_file_details_w; #ifdef NTGUI_UNICODE - wchar_t filename_buf_w[32*1024 + 1]; // NT kernel maximum + wchar_t filename_buf_w[32*1024 + 1]; /* NT kernel maximum */ OPENFILENAMEW * file_details_w = &new_file_details_w.details; const int use_unicode = 1; #else /* not NTGUI_UNICODE */ diff --git a/src/xdisp.c b/src/xdisp.c index a13830c811e..f575b27fec5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -24461,7 +24461,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, } if (FRAME_WINDOW_P (it->f) && valid_xwidget_spec_p (prop)) { - // TODO: Don't return dummy size. + /* TODO: Don't return dummy size. */ return OK_PIXELS (100); } #endif diff --git a/src/xselect.c b/src/xselect.c index 123e46374a2..ff6dc3287cf 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -693,7 +693,7 @@ x_reply_selection_request (struct selection_input_event *event, : format_bytes); XFlush (display); had_errors_p = x_had_errors_p (display); - // See comment above about property_change_reply. + /* See comment above about property_change_reply. */ set_property_change_object (cs->wait_object); unblock_input (); @@ -1393,7 +1393,7 @@ receive_incremental_selection (struct x_display_info *dpyinfo, wait_object = expect_property_change (display, window, property, PropertyNewValue); XFlush (display); - // See comment in x_reply_selection_request about property_change_reply. + /* See comment in x_reply_selection_request about property_change_reply. */ set_property_change_object (wait_object); unblock_input (); @@ -1433,7 +1433,8 @@ receive_incremental_selection (struct x_display_info *dpyinfo, XDeleteProperty (display, window, property); wait_object = expect_property_change (display, window, property, PropertyNewValue); - // See comment in x_reply_selection_request about property_change_reply. + /* See comment in x_reply_selection_request about + property_change_reply. */ set_property_change_object (wait_object); XFlush (display); unblock_input (); diff --git a/src/xsmfns.c b/src/xsmfns.c index 42e23401c7d..d54a94df877 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -170,7 +170,7 @@ smc_save_yourself_CB (SmcConn smcConn, char *smid_opt, *chdir_opt = NULL; Lisp_Object user_login_name = Fuser_login_name (Qnil); - // Must have these. + /* Must have these. */ if (! STRINGP (Vinvocation_name) || ! STRINGP (user_login_name)) return; diff --git a/src/xterm.c b/src/xterm.c index c64c17463cf..213a527d55d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11950,7 +11950,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) #else /* not USE_X_TOOLKIT */ XSetLocaleModifiers (""); - unrequest_sigio (); // See comment in x_display_ok. + unrequest_sigio (); /* See comment in x_display_ok. */ dpy = XOpenDisplay (SSDATA (display_name)); request_sigio (); #endif /* not USE_X_TOOLKIT */ -- cgit v1.2.1