handle missing return values

This commit is contained in:
Patrick Georgi
2025-12-09 22:38:19 +01:00
parent 1b852f19a5
commit 7ab683d29a
22 changed files with 48 additions and 41 deletions

View File

@@ -213,7 +213,7 @@ extern void DtSearchFreeMessages (void);
extern int DtSearchGetMaxResults (void);
extern void DtSearchSetMaxResults (int new_max_results);
extern char *DtSearchFormatObjdate (DtSrObjdate objdate);
extern void DtSearchExit (int return_code);
extern void DtSearchExit (int return_code) __attribute__((noreturn));
extern void DtSearchAddUserExit (void (*user_exit)(int));
extern void DtSearchRemoveUserExit (void);

View File

@@ -8732,7 +8732,7 @@ FormatSDLTitle(
* Purpose:
*
******************************************************************************/
static int
static void
SetGhostLink(
_DtCvLinkDb link_data,
_DtCvSegment *segments,

View File

@@ -2916,6 +2916,7 @@ size_t _DtGrRead(
return (num_items);
}
}
return 0;
}
/******************************************************************************
@@ -2969,6 +2970,7 @@ int _DtGrSeek(
else
return(-1); /* Failure */
}
return -1;
}
/******************************************************************************
@@ -2997,6 +2999,7 @@ int _DtGrGetChar(
else
return ((unsigned char) *(stream->source.buffer.current++));
}
return EOF;
}
/******************************************************************************
@@ -3058,4 +3061,5 @@ char *_DtGrGetString(
*buffer = '\0';
return (save);
}
return NULL;
}

View File

@@ -379,7 +379,7 @@ SkipOtherLines(
* Function: CheckAndSwitchPoints
*
*****************************************************************************/
static int
static void
CheckAndSwitchPoints(
_DtCvSelectData *pt1,
_DtCvSelectData *pt2)

View File

@@ -1364,4 +1364,5 @@ ilError error;
} /* END while true: execute strips */
} /* END switch pipe state */
return IL_EXECUTE_AGAIN;
}

View File

@@ -111,6 +111,7 @@ void (*austext_exit_last) (int) = NULL;
/* DtSearchExit */
/* */
/****************************************/
__attribute__((noreturn))
void DtSearchExit (int return_code)
{
if (austext_exit_first != NULL)

View File

@@ -579,11 +579,9 @@ static DtSrResult *ditto_sort (DtSrResult * lst)
return merge_by_prox (ditto_sort (lst), ditto_sort (lst2));
case DtSrSORT_DATE:
return merge_by_date (ditto_sort (lst), ditto_sort (lst2));
default:
fprintf (aa_stderr, PROGNAME "525 Invalid Sort Type %d.\n",
ditsort_type);
DtSearchExit (32);
}
fprintf (aa_stderr, PROGNAME "525 Invalid Sort Type %d.\n", ditsort_type);
DtSearchExit (32);
} /* ditto_sort() */

View File

@@ -852,10 +852,9 @@ static int _DtAct_tt_message_arg_reptype( Tt_message message, int arg )
status = tt_message_arg_ival( message, arg, &testVal );
if (status == TT_OK)
return( DtACT_TT_REP_INT);
else if (status == TT_ERR_NUM)
return( DtACT_TT_REP_BUFFER );
if (status == TT_ERR_NUM)
return DtACT_TT_REP_BUFFER;
return DtACT_TT_REP_INT;
}
/******************************************************************************

View File

@@ -864,5 +864,6 @@ regstat4_to_dtcmstatus(Registration_Status_4 stat4)
case confused_4:
return (CSA_E_FAILURE);
}
return CSA_E_FAILURE;
}

View File

@@ -1046,7 +1046,7 @@ match_this_attribute(Appt_4 *appt, cms_attribute attr, CSA_enum op)
return (_DtCm_match_sint32_attribute(&oldattr,
(attr.value ? &matchattr : NULL), op));
defalut:
default:
return (B_FALSE);
}
}

View File

@@ -601,16 +601,10 @@ _DtCmsSetCalendarAttrs4Parser(
extern CSA_return_code
_DtCmsRbToCsaStat(Rb_Status rb_stat)
{
switch (rb_stat) {
case rb_ok:
return (CSA_SUCCESS);
case rb_duplicate:
case rb_badtable:
case rb_notable:
case rb_failed:
case rb_other:
return (CSA_E_FAILURE);
if (rb_stat == rb_ok) {
return CSA_SUCCESS;
}
return CSA_E_FAILURE;
}
extern void

View File

@@ -173,6 +173,7 @@ ushort GetContentsType(void)
return((ushort)CA_FT_CNTLONG);
}
/* NOTREACHED */
return -1;
}
/******************************************************************************/

View File

@@ -1303,6 +1303,7 @@ TblGetAlign(short col, /* column number */
case Char: return 'd';
case Span: return 's';
}
return 'l';
}
/* TblGetWidth() -- get width spec, if any, for a entry

View File

@@ -2159,7 +2159,7 @@ rename the file you are changing so it no longer has the same name.");
} /* end switch (mode) */
} /* end switch (message) */
return "";
} /* end getVariableMessage */
static Boolean

View File

@@ -61,6 +61,17 @@
static int flood_min_x, flood_min_y, flood_max_x, flood_max_y;
static void Set_FloodLimits(int x, int y);
static void Flood_Fill(
XImage *color_image,
XImage *mono_image,
int x,
int y,
int width,
int height,
unsigned long new_pixel,
unsigned long new_mono);
/***************************************************************************
* *
* Routine: Mirror_Image *
@@ -76,7 +87,6 @@ int
Mirror_Image(
int orientation )
{
XRectangle tmp_box;
XImage *new_image, *old_image, *new_mono, *old_mono;
unsigned long n;
int i, j;
@@ -416,7 +426,7 @@ Flood_Region(
* *
*X11***********************************************************************/
void
static void
Set_FloodLimits(
int x,
int y )
@@ -473,7 +483,7 @@ struct seg {short y, xl, xr, dy;};
int local_debug=False, p_cnt;
#endif
int
static void
Flood_Fill(
XImage *color_image,
XImage *mono_image,
@@ -489,7 +499,7 @@ Flood_Fill(
struct seg stack[MAX], *sp = stack;
old_pixel = XGetPixel(color_image, x, y); /* read pv at seed point */
if (old_pixel==new_pixel || x<0 || x>width || y<0 || y>height) return 0;
if (old_pixel==new_pixel || x<0 || x>width || y<0 || y>height) return;
PUSH(y, x, x, 1); /* needed in some cases */
PUSH(y+1, x, x, -1); /* seed segment (popped 1st) */

View File

@@ -28,5 +28,3 @@ int Mirror_Image(int orientation);
int Block_Rotate(XImage *src_image, XImage *dst_image, int rtype);
void Scale_Image(void);
int Flood_Region(int flood_x, int flood_y);
void Set_FloodLimits(int x, int y);
int Flood_Fill(XImage *color_image, XImage *mono_image, int x, int y, int width, int height, unsigned long new_pixel, unsigned long new_mono);

View File

@@ -848,7 +848,7 @@ extern int source(
/******************************* socket.c **************************/
extern int AnyWellKnownSockets( void ) ;
extern int CreateWellKnownSockets( void ) ;
extern void CreateWellKnownSockets( void ) ;
extern void DestroyWellKnownSockets( void ) ;
extern char * NetworkAddressToHostname(
#if NeedWidePrototypes

View File

@@ -108,20 +108,20 @@ extern int WellKnownSocketsMax;
void registerHostname (char *name, int namelen); // xdmcp.c
int
void
CreateWellKnownSockets (void)
{
struct sockaddr_in sock_addr;
char *name, *localHostname();
if (request_port == 0)
return 0;
return;
Debug ("creating socket %d\n", request_port);
xdmcpFd = socket (AF_INET, SOCK_DGRAM, 0);
if (xdmcpFd == -1) {
LogError (ReadCatalog(MC_LOG_SET,MC_LOG_FAIL_SOCK,MC_DEF_LOG_FAIL_SOCK),
request_port);
return 0;
return;
}
name = localHostname ();
registerHostname (name, strlen (name));
@@ -140,7 +140,7 @@ CreateWellKnownSockets (void)
request_port, errno);
close (xdmcpFd);
xdmcpFd = -1;
return 0;
return;
}
WellKnownSocketsMax = xdmcpFd;
FD_SET (xdmcpFd, &WellKnownSocketsMask);
@@ -150,7 +150,7 @@ CreateWellKnownSockets (void)
if (chooserFd == -1)
{
LogError ((unsigned char *)"chooser socket creation failed, errno %d\n", errno);
return 0;
return;
}
listen (chooserFd, 5);
if (chooserFd > WellKnownSocketsMax)

View File

@@ -1738,7 +1738,9 @@ HostCB(Tt_message m, Tt_pattern p)
if (state == TT_HANDLED) {
value = tt_message_arg_val(m, 1);
waitCB = 0;
return TT_CALLBACK_PROCESSED;
}
return TT_CALLBACK_CONTINUE;
}
/************************************************************************

View File

@@ -1654,14 +1654,12 @@ const char* PdmOidNotifyString(PdmOidNotify notify)
{
case PDMOID_NOTIFY_UNSUPPORTED:
return (const char*)NULL;
break;
case PDMOID_NOTIFY_NONE:
return NOTIFY_NONE_STR;
break;
case PDMOID_NOTIFY_EMAIL:
return NOTIFY_EMAIL_STR;
break;
}
return (const char*)NULL;
}
/*

View File

@@ -2049,6 +2049,7 @@ QueryGeometry(
desired->width = 1;
if (desired->height == 0)
desired->height = 1;
return XtGeometryYes;
}
/*

View File

@@ -1409,8 +1409,7 @@ max(
if(y >= z && y >= x)
return(y);
if(z >= y && z >= x)
return(z);
return(z);
}
/************************************************************************
@@ -1429,8 +1428,7 @@ min(
if(y <= z && y <= x)
return(y);
if(z <= y && z <= x)
return(z);
return(z);
}
/************************************************************************