misc: Fix a small pile of warnings found with diagnostics turned way up

* possible null pointer dereferences
 * non-annotated fallthroughs in case statements

Change-Id: I2332e0e0a4203ceca0999291ead112b8ab94c613
This commit is contained in:
Solomon Peachy 2025-09-06 21:31:58 -04:00
parent d51d49550c
commit 34f34bb7f1
9 changed files with 46 additions and 43 deletions

View file

@ -1735,6 +1735,7 @@ static void typingProcess(void){
clearOperand(); clearOperand();
calStatus = cal_typing; calStatus = cal_typing;
/* go on typing, no break */ /* go on typing, no break */
/* Intentional fallthrough */
case cal_typing: case cal_typing:
case cal_dotted: case cal_dotted:
switch(CAL_BUTTON){ switch(CAL_BUTTON){

View file

@ -1304,7 +1304,7 @@ read_comment_sgf (char *buffer, size_t buffer_size)
{ {
break; break;
} }
/* Intentional fallthrough */
default: default:
*buffer = temp; *buffer = temp;
++buffer; ++buffer;

View file

@ -152,6 +152,7 @@ free_tree_sgf (void)
{ {
rb->splash (5 * HZ, rb->splash (5 * HZ,
"Error allocating first node! Please exit immediately."); "Error allocating first node! Please exit immediately.");
return;
} }
get_node (tree_head)->props = NO_PROP; get_node (tree_head)->props = NO_PROP;
@ -498,4 +499,3 @@ get_prop (int handle)
} }
return &(storage_buffer[index][handle].prop); return &(storage_buffer[index][handle].prop);
} }

View file

@ -406,6 +406,7 @@ static int ask_and_get_audio_buffer(const char *filename)
break; break;
#endif #endif
#endif #endif
/* Intentional fallthrough */
case IMGVIEW_MENU: case IMGVIEW_MENU:
return PLUGIN_OK; return PLUGIN_OK;

View file

@ -809,8 +809,7 @@ static int scrobbler_context_menu(struct printcell_data_t *pc_data)
if (find_type == FIND_ALL) if (find_type == FIND_ALL)
find_type = FIND_INCLUDE; find_type = FIND_INCLUDE;
/* fallthrough */ } /* fall-through */
}
case 3: /*Custom Filter / Settings */ case 3: /*Custom Filter / Settings */
{ {
if (col == -1)/*Settings*/ if (col == -1)/*Settings*/

View file

@ -655,7 +655,7 @@ void ugen_connect(t_dspcontext *dc, t_object *x1, int outno, t_object *x2,
for (u2 = dc->dc_ugenlist; u2 && u2->u_obj != x2; u2 = u2->u_next); for (u2 = dc->dc_ugenlist; u2 && u2->u_obj != x2; u2 = u2->u_next);
if (!u1 || !u2 || siginno < 0) if (!u1 || !u2 || siginno < 0)
{ {
pd_error(u1->u_obj, pd_error((u1 ? u1->u_obj : NULL),
"signal outlet connect to nonsignal inlet (ignored)"); "signal outlet connect to nonsignal inlet (ignored)");
return; return;
} }
@ -1159,4 +1159,3 @@ void d_ugen_setup(void) /* really just block_setup */
class_addmethod(block_class, (t_method)block_dsp, gensym("dsp"), 0); class_addmethod(block_class, (t_method)block_dsp, gensym("dsp"), 0);
class_addfloat(block_class, block_float); class_addfloat(block_class, block_float);
} }

View file

@ -713,6 +713,7 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
break; break;
case A_FLOAT: case A_FLOAT:
if (!argc) goto badarg; if (!argc) goto badarg;
/* Intentional fallthrough */
case A_DEFFLOAT: case A_DEFFLOAT:
if (!argc) *dp = 0; if (!argc) *dp = 0;
else else
@ -727,6 +728,7 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
break; break;
case A_SYMBOL: case A_SYMBOL:
if (!argc) goto badarg; if (!argc) goto badarg;
/* Intentional fallthrough */
case A_DEFSYM: case A_DEFSYM:
if (!argc) *ap = (t_int)(&s_); if (!argc) *ap = (t_int)(&s_);
else else
@ -861,4 +863,3 @@ t_gotfn zgetfn(t_pd *x, t_symbol *s)
if (m->me_name == s) return(m->me_fun); if (m->me_name == s) return(m->me_fun);
return(0); return(0);
} }

View file

@ -269,6 +269,7 @@ static byte ioreg_read(byte r)
case RI_HDMA4: case RI_HDMA4:
case RI_HDMA5: case RI_HDMA5:
if (hw.cgb) return REG(r); if (hw.cgb) return REG(r);
/* Intentional fallthrough */
default: default:
return 0xff; return 0xff;
} }

View file

@ -88,6 +88,7 @@ void audio_input_mux(int source, unsigned flags)
{ {
default: /* playback - no recording */ default: /* playback - no recording */
source = AUDIO_SRC_PLAYBACK; source = AUDIO_SRC_PLAYBACK;
/* Intentional fallthrough */
case AUDIO_SRC_PLAYBACK: case AUDIO_SRC_PLAYBACK:
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
if (source != last_source) if (source != last_source)