From 9b89de2571b0c3fa2276b5c2ae589e0ec831d1f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 3 Jul 2021 23:08:40 +1000 Subject: Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXX Also use doxy style function reference `#` prefix chars when referencing identifiers. --- source/blender/windowmanager/intern/wm.c | 2 +- source/blender/windowmanager/intern/wm_cursors.c | 2 +- .../blender/windowmanager/intern/wm_event_system.c | 20 ++++++++++---------- source/blender/windowmanager/intern/wm_files.c | 10 +++++----- source/blender/windowmanager/intern/wm_gesture_ops.c | 2 +- source/blender/windowmanager/intern/wm_init_exit.c | 10 +++++----- source/blender/windowmanager/intern/wm_keymap.c | 2 +- .../blender/windowmanager/intern/wm_operator_props.c | 4 ++-- source/blender/windowmanager/intern/wm_operators.c | 12 ++++++------ source/blender/windowmanager/intern/wm_playanim.c | 6 +++--- .../blender/windowmanager/intern/wm_splash_screen.c | 2 +- source/blender/windowmanager/intern/wm_window.c | 6 ++---- 12 files changed, 38 insertions(+), 40 deletions(-) (limited to 'source/blender/windowmanager/intern') diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 6dd3e4186c4..d59ebabc643 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -516,7 +516,7 @@ void WM_check(bContext *C) } /* Case: fileread. */ - /* Note: this runs in background mode to set the screen context cb. */ + /* NOTE: this runs in background mode to set the screen context cb. */ if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) { ED_screens_init(bmain, wm); wm->initialized |= WM_WINDOW_IS_INIT; diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 11783ae3517..3b78327872d 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -301,7 +301,7 @@ void WM_cursor_grab_disable(wmWindow *win, const int mouse_ungrab_xy[2]) static void wm_cursor_warp_relative(wmWindow *win, int x, int y) { - /* note: don't use wmEvent coords because of continuous grab T36409. */ + /* NOTE: don't use wmEvent coords because of continuous grab T36409. */ int cx, cy; wm_cursor_position_get(win, &cx, &cy); WM_cursor_warp(win, cx + x, cy + y); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index b82b3c1ff5d..46c6e139d47 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -129,7 +129,7 @@ wmEvent *wm_event_add_ex(wmWindow *win, BLI_addtail(&win->event_queue, event); } else { - /* Note: strictly speaking this breaks const-correctness, + /* NOTE: strictly speaking this breaks const-correctness, * however we're only changing 'next' member. */ BLI_insertlinkafter(&win->event_queue, (void *)event_to_add_after, event); } @@ -189,7 +189,7 @@ void wm_event_free(wmEvent *event) if (event->customdata) { if (event->customdatafree) { - /* Note: pointer to listbase struct elsewhere. */ + /* NOTE: pointer to listbase struct elsewhere. */ if (event->custom == EVT_DATA_DRAGDROP) { ListBase *lb = event->customdata; WM_drag_free_list(lb); @@ -915,7 +915,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool ca { if (G.background == 0 && caller_owns_reports == false) { /* popup */ if (op->reports->list.first) { - /* FIXME, temp setting window, see other call to UI_popup_menu_reports for why. */ + /* FIXME: temp setting window, see other call to #UI_popup_menu_reports for why. */ wmWindow *win_prev = CTX_wm_window(C); ScrArea *area_prev = CTX_wm_area(C); ARegion *region_prev = CTX_wm_region(C); @@ -1370,7 +1370,7 @@ static int wm_operator_invoke(bContext *C, CLOG_ERROR(WM_LOG_OPERATORS, "invalid operator call '%s'", op->idname); } - /* Note, if the report is given as an argument then assume the caller will deal with displaying + /* NOTE: if the report is given as an argument then assume the caller will deal with displaying * them currently Python only uses this. */ if (!(retval & OPERATOR_HANDLED) && (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED))) { /* Only show the report if the report list was not given in the function. */ @@ -2379,9 +2379,9 @@ static int wm_handler_fileselect_do(bContext *C, if (handler->op->reports->list.first) { - /* FIXME, temp setting window, this is really bad! + /* FIXME(campbell): temp setting window, this is really bad! * only have because lib linking errors need to be seen by users :( - * it can be removed without breaking anything but then no linking errors - campbell */ + * it can be removed without breaking anything but then no linking errors. */ wmWindow *win_prev = CTX_wm_window(C); ScrArea *area_prev = CTX_wm_area(C); ARegion *region_prev = CTX_wm_region(C); @@ -2393,7 +2393,7 @@ static int wm_handler_fileselect_do(bContext *C, BKE_report_print_level_set(handler->op->reports, RPT_WARNING); UI_popup_menu_reports(C, handler->op->reports); - /* XXX - copied from 'wm_operator_finished()' */ + /* XXX: copied from 'wm_operator_finished()'. */ /* add reports to the global list, otherwise they are not seen */ BLI_movelisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list); @@ -2796,7 +2796,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers /* Modal handlers can get removed in this loop, we keep the loop this way. * - * Note: check 'handlers->first' because in rare cases the handlers can be cleared + * NOTE: check 'handlers->first' because in rare cases the handlers can be cleared * by the event that's called, for eg: * * Calling a python script which changes the area.type, see T32232. */ @@ -3398,7 +3398,7 @@ void wm_event_do_handlers(bContext *C) wm_tweakevent_test(C, event, action); if ((action & WM_HANDLER_BREAK) == 0) { - /* Note: setting subwin active should be done here, after modal handlers have been done */ + /* NOTE: setting subwin active should be done here, after modal handlers have been done. */ if (event->type == MOUSEMOVE) { /* State variables in screen, cursors. * Also used in wm_draw.c, fails for modal handlers though. */ @@ -4011,7 +4011,7 @@ wmEventHandler_Dropbox *WM_event_add_dropbox_handler(ListBase *handlers, ListBas return handler; } -/* XXX solution works, still better check the real cause (ton) */ +/* XXX(ton): solution works, still better check the real cause. */ void WM_event_remove_area_handler(ListBase *handlers, void *area) { LISTBASE_FOREACH_MUTABLE (wmEventHandler *, handler_base, handlers) { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 6230b240d11..c85727175b2 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -844,7 +844,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports) /* first try to append data from exotic file formats... */ /* it throws error box when file doesn't exist and returns -1 */ - /* note; it should set some error message somewhere... (ton) */ + /* NOTE(ton): it should set some error message somewhere. */ const int retval = wm_read_exotic(filepath); /* we didn't succeed, now try to read Blender file */ @@ -1606,7 +1606,7 @@ static bool wm_file_write(bContext *C, return ok; } - /* note: used to replace the file extension (to ensure '.blend'), + /* NOTE: used to replace the file extension (to ensure '.blend'), * no need to now because the operator ensures, * its handy for scripts to save to a predefined name without blender editing it */ @@ -1645,13 +1645,13 @@ static bool wm_file_write(bContext *C, ED_editors_flush_edits(bmain); - /* first time saving */ - /* XXX temp solution to solve bug, real fix coming (ton) */ + /* First time saving. */ + /* XXX(ton): temp solution to solve bug, real fix coming. */ if ((BKE_main_blendfile_path(bmain)[0] == '\0') && (use_save_as_copy == false)) { BLI_strncpy(bmain->name, filepath, sizeof(bmain->name)); } - /* XXX temp solution to solve bug, real fix coming (ton) */ + /* XXX(ton): temp solution to solve bug, real fix coming. */ bmain->recovered = 0; if (BLO_write_file(CTX_data_main(C), diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c b/source/blender/windowmanager/intern/wm_gesture_ops.c index 94535427dac..9da901d6c4e 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.c +++ b/source/blender/windowmanager/intern/wm_gesture_ops.c @@ -447,7 +447,7 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event) #if 0 /* Allow view navigation??? */ - /* note, this gives issues: + /* NOTE: this gives issues: * 1) other modal ops run on top (box select), * 2) middle-mouse is used now 3) tablet/trackpad? */ else { diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 48ab76317b5..e225b9f8aca 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -226,7 +226,7 @@ void WM_init(bContext *C, int argc, const char **argv) { if (!G.background) { - wm_ghost_init(C); /* note: it assigns C to ghost! */ + wm_ghost_init(C); /* NOTE: it assigns C to ghost! */ wm_init_cursor_data(); BKE_sound_jack_sync_callback_set(sound_jack_sync_callback); } @@ -327,13 +327,13 @@ void WM_init(bContext *C, int argc, const char **argv) ED_spacemacros_init(); - /* note: there is a bug where python needs initializing before loading the + /* NOTE(campbell): there is a bug where python needs initializing before loading the * startup.blend because it may contain PyDrivers. It also needs to be after * initializing space types and other internal data. * * However can't redo this at the moment. Solution is to load python * before wm_homefile_read() or make py-drivers check if python is running. - * Will try fix when the crash can be repeated. - campbell. */ + * Will try fix when the crash can be repeated. */ #ifdef WITH_PYTHON BPY_python_start(C, argc, argv); @@ -376,7 +376,7 @@ void WM_init(bContext *C, int argc, const char **argv) { Main *bmain = CTX_data_main(C); - /* note, logic here is from wm_file_read_post, + /* NOTE: logic here is from wm_file_read_post, * call functions that depend on Python being initialized. */ /* normally 'wm_homefile_read' will do this, @@ -481,7 +481,7 @@ void WM_exit_ex(bContext *C, const bool do_python) /* first wrap up running stuff, we assume only the active WM is running */ /* modal handlers are on window level freed, others too? */ - /* note; same code copied in wm_files.c */ + /* NOTE: same code copied in `wm_files.c`. */ if (C && wm) { if (!G.background) { struct MemFile *undo_memfile = wm->undo_stack ? diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 69b3660038d..e9039f3b03f 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -135,7 +135,7 @@ static void wm_keymap_item_properties_update_ot(wmKeyMapItem *kmi) /* matches wm_keymap_item_properties_set but doesn't alloc new ptr */ WM_operator_properties_create_ptr(kmi->ptr, ot); /* 'kmi->ptr->data' NULL'd above, keep using existing properties. - * Note: the operators property types may have changed, + * NOTE: the operators property types may have changed, * we will need a more comprehensive sanitize function to support this properly. */ if (kmi->properties) { diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index ba236988c1d..898671706d1 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -133,7 +133,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, } if (action == FILE_SAVE) { - /* note, this is only used to check if we should highlight the filename area red when the + /* NOTE: this is only used to check if we should highlight the filename area red when the * filepath is an existing file. */ prop = RNA_def_boolean(ot->srna, "check_existing", @@ -198,7 +198,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, ot->srna, "filter_blenlib", (filter & FILE_TYPE_BLENDERLIB) != 0, "Filter Blender IDs", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - /* TODO asset only filter? */ + /* TODO: asset only filter? */ prop = RNA_def_int( ot->srna, diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index a2d783afc32..485e65cf3dc 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -126,8 +126,8 @@ void WM_operator_py_idname(char *to, const char *from) if (sep) { int ofs = (sep - from); - /* note, we use ascii tolower instead of system tolower, because the - * latter depends on the locale, and can lead to idname mismatch */ + /* NOTE: we use ascii `tolower` instead of system `tolower`, because the + * latter depends on the locale, and can lead to `idname` mismatch. */ memcpy(to, from, sizeof(char) * ofs); BLI_str_tolower_ascii(to, ofs); @@ -745,7 +745,7 @@ static bool operator_last_properties_init_impl(wmOperator *op, IDProperty *last_ if (idp_src) { IDProperty *idp_dst = IDP_CopyProperty(idp_src); - /* note - in the future this may need to be done recursively, + /* NOTE: in the future this may need to be done recursively, * but for now RNA doesn't access nested operators */ idp_dst->flag |= IDP_FLAG_GHOST; @@ -1156,7 +1156,7 @@ bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFor RNA_property_string_get(op->ptr, prop, filepath); if (BKE_image_path_ensure_ext_from_imformat(filepath, im_format)) { RNA_property_string_set(op->ptr, prop, filepath); - /* note, we could check for and update 'filename' here, + /* NOTE: we could check for and update 'filename' here, * but so far nothing needs this. */ return true; } @@ -2361,7 +2361,7 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void strdrawlen = BLI_strlen_utf8(str); break; default: - tex_radius = WM_RADIAL_CONTROL_DISPLAY_SIZE; /* note, this is a dummy value */ + tex_radius = WM_RADIAL_CONTROL_DISPLAY_SIZE; /* NOTE: this is a dummy value. */ alpha = 0.75; break; } @@ -3202,7 +3202,7 @@ static void redraw_timer_step(bContext *C, int tot = (scene->r.efra - scene->r.sfra) + 1; while (tot--) { - /* todo, ability to escape! */ + /* TODO: ability to escape! */ scene->r.cfra++; if (scene->r.cfra > scene->r.efra) { scene->r.cfra = scene->r.sfra; diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 5300649a0cd..1f081d3b02e 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -220,7 +220,7 @@ static void playanim_window_get_size(int *r_width, int *r_height) static void playanim_gl_matrix(void) { /* unified matrix, note it affects offset for drawing */ - /* note! cannot use GPU_matrix_ortho_2d_set here because shader ignores. */ + /* NOTE: cannot use GPU_matrix_ortho_2d_set here because shader ignores. */ GPU_matrix_ortho_set(0.0f, 1.0f, 0.0f, 1.0f, -1.0, 1.0f); } @@ -1114,7 +1114,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) #ifdef WITH_AUDASPACE { PlayAnimPict *picture = picsbase.first; - /* TODO - store in ps direct? */ + /* TODO: store in ps direct? */ int i = 0; while (picture && picture != ps->picture) { @@ -1151,7 +1151,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) #ifdef WITH_AUDASPACE { PlayAnimPict *picture = picsbase.first; - /* TODO - store in ps direct? */ + /* TODO: store in ps direct? */ int i = 0; while (picture && picture != ps->picture) { i++; diff --git a/source/blender/windowmanager/intern/wm_splash_screen.c b/source/blender/windowmanager/intern/wm_splash_screen.c index ae726e73fe7..f5881a00998 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.c +++ b/source/blender/windowmanager/intern/wm_splash_screen.c @@ -112,7 +112,7 @@ static void wm_block_splash_image_roundcorners_add(ImBuf *ibuf) const float distance = sqrt(u * u + v * v); /* Pointer offset to the alpha value of pixel. */ - /* Note, the left corner is flipped in the X-axis. */ + /* NOTE: the left corner is flipped in the X-axis. */ const int offset_l = 4 * (size - x - x - 1) + 3; const int offset_r = 4 * (ibuf->x - size) + 3; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 8f8577e2616..b61975e1b1a 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1136,14 +1136,12 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr return 1; } if (!ghostwin) { - /* XXX - should be checked, why are we getting an event here, and */ - /* what is it? */ + /* XXX: should be checked, why are we getting an event here, and what is it? */ puts(" event has no window"); return 1; } if (!GHOST_ValidWindow(g_system, ghostwin)) { - /* XXX - should be checked, why are we getting an event here, and */ - /* what is it? */ + /* XXX: should be checked, why are we getting an event here, and what is it? */ puts(" event has invalid window"); return 1; } -- cgit v1.2.3