mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix several pointer-bool-conversion warnings that could cause cores
This commit is contained in:
parent
adc056eb83
commit
d470302354
6 changed files with 18 additions and 15 deletions
|
@ -220,7 +220,7 @@ void getAF_Icons(FiletypeData *pFiletypedata)
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
pIconData = GetIconDataFromWid(AF_MED_IconGadget);
|
pIconData = GetIconDataFromWid(AF_MED_IconGadget);
|
||||||
if ( (pIconData->pmDirtyBit) &&
|
if ( (pIconData->pmDirtyBit) &&
|
||||||
(pIconData->pmFileName) &&
|
(pIconData->pmFileName[0]) &&
|
||||||
(strlen(pIconData->pmFileName)) ) {
|
(strlen(pIconData->pmFileName)) ) {
|
||||||
pFiletypedata->pszMedPmIcon = XtMalloc(strlen(pIconData->pmFileName) + 1);
|
pFiletypedata->pszMedPmIcon = XtMalloc(strlen(pIconData->pmFileName) + 1);
|
||||||
if (pFiletypedata->pszMedPmIcon) {
|
if (pFiletypedata->pszMedPmIcon) {
|
||||||
|
@ -234,7 +234,7 @@ void getAF_Icons(FiletypeData *pFiletypedata)
|
||||||
/* Medium Bitmap */
|
/* Medium Bitmap */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
if ( (pIconData->bmDirtyBit) &&
|
if ( (pIconData->bmDirtyBit) &&
|
||||||
(pIconData->bmFileName) &&
|
(pIconData->bmFileName[0]) &&
|
||||||
(strlen(pIconData->bmFileName)) ) {
|
(strlen(pIconData->bmFileName)) ) {
|
||||||
pFiletypedata->pszMedBmIcon = XtMalloc(strlen(pIconData->bmFileName) + 1);
|
pFiletypedata->pszMedBmIcon = XtMalloc(strlen(pIconData->bmFileName) + 1);
|
||||||
if (pFiletypedata->pszMedBmIcon) {
|
if (pFiletypedata->pszMedBmIcon) {
|
||||||
|
@ -249,7 +249,7 @@ void getAF_Icons(FiletypeData *pFiletypedata)
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
pIconData = GetIconDataFromWid(AF_TINY_IconGadget);
|
pIconData = GetIconDataFromWid(AF_TINY_IconGadget);
|
||||||
if ( (pIconData->pmDirtyBit) &&
|
if ( (pIconData->pmDirtyBit) &&
|
||||||
(pIconData->pmFileName) &&
|
(pIconData->pmFileName[0]) &&
|
||||||
(strlen(pIconData->pmFileName)) ) {
|
(strlen(pIconData->pmFileName)) ) {
|
||||||
pFiletypedata->pszTinyPmIcon = XtMalloc(strlen(pIconData->pmFileName) + 1);
|
pFiletypedata->pszTinyPmIcon = XtMalloc(strlen(pIconData->pmFileName) + 1);
|
||||||
if (pFiletypedata->pszTinyPmIcon) {
|
if (pFiletypedata->pszTinyPmIcon) {
|
||||||
|
|
|
@ -700,7 +700,7 @@ void SetIconData(Widget wid, char *pszIconFile, enum icon_size_range enumIconSiz
|
||||||
pIconData = GetIconDataFromWid(wid);
|
pIconData = GetIconDataFromWid(wid);
|
||||||
if (pIconData) {
|
if (pIconData) {
|
||||||
if ( (pIconData->pmDirtyBit) &&
|
if ( (pIconData->pmDirtyBit) &&
|
||||||
(pIconData->pmFileName) &&
|
(pIconData->pmFileName[0]) &&
|
||||||
(strlen(pIconData->pmFileName)) ) {
|
(strlen(pIconData->pmFileName)) ) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("SetIconData: unlink '%s'\n", pIconData->pmFileName); /* debug */
|
printf("SetIconData: unlink '%s'\n", pIconData->pmFileName); /* debug */
|
||||||
|
|
|
@ -634,7 +634,7 @@ void RemoveTmpIconFiles( void )
|
||||||
|
|
||||||
for (i=0; i < ICON_NUMBER; i++) {
|
for (i=0; i < ICON_NUMBER; i++) {
|
||||||
if ( (IconDataList[i]->pmDirtyBit) &&
|
if ( (IconDataList[i]->pmDirtyBit) &&
|
||||||
(IconDataList[i]->pmFileName) &&
|
(IconDataList[i]->pmFileName[0]) &&
|
||||||
(strlen(IconDataList[i]->pmFileName)) ) {
|
(strlen(IconDataList[i]->pmFileName)) ) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("RemoveTmpIconFiles: unlink '%s'\n", IconDataList[i]->pmFileName); /* debug */
|
printf("RemoveTmpIconFiles: unlink '%s'\n", IconDataList[i]->pmFileName); /* debug */
|
||||||
|
|
|
@ -221,10 +221,13 @@ Boolean
|
||||||
Read_File(
|
Read_File(
|
||||||
char *fnameIn )
|
char *fnameIn )
|
||||||
{
|
{
|
||||||
char *base_name, *suffix, fname[MAXPATHLEN+1], *tmp, *tmp2;
|
char *base_name = NULL, *suffix = NULL,
|
||||||
unsigned int mask_width_ret, mask_height_ret;
|
fname[MAXPATHLEN], *tmp = NULL, *tmp2 = NULL;
|
||||||
int mask_x_hot, mask_y_hot, first;
|
unsigned int mask_width_ret = 0, mask_height_ret = 0;
|
||||||
struct stat statBuf;
|
int mask_x_hot = 0, mask_y_hot = 0, first = 0;
|
||||||
|
struct stat statBuf = {};
|
||||||
|
|
||||||
|
fname[0] = 0;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@ -241,7 +244,7 @@ Read_File(
|
||||||
if (tmp && tmp2 && (tmp2 == tmp+1))
|
if (tmp && tmp2 && (tmp2 == tmp+1))
|
||||||
{
|
{
|
||||||
char *netfile, *localfile;
|
char *netfile, *localfile;
|
||||||
|
|
||||||
tmp[0] = '\0';
|
tmp[0] = '\0';
|
||||||
netfile = tt_host_file_netfile(fnameIn, tmp+1);
|
netfile = tt_host_file_netfile(fnameIn, tmp+1);
|
||||||
localfile = tt_netfile_file(netfile);
|
localfile = tt_netfile_file(netfile);
|
||||||
|
@ -259,7 +262,7 @@ Read_File(
|
||||||
|
|
||||||
/*** - if we got a NULL base_name, return FALSE ***/
|
/*** - if we got a NULL base_name, return FALSE ***/
|
||||||
base_name = strrchr(fname, '/');
|
base_name = strrchr(fname, '/');
|
||||||
if (fname)
|
if (fname[0])
|
||||||
base_name = (base_name ? base_name + 1 : fname);
|
base_name = (base_name ? base_name + 1 : fname);
|
||||||
if (!base_name)
|
if (!base_name)
|
||||||
return (False);
|
return (False);
|
||||||
|
@ -491,7 +494,7 @@ Write_File(
|
||||||
|
|
||||||
|
|
||||||
base_name = strrchr(fname, '/');
|
base_name = strrchr(fname, '/');
|
||||||
if (fname) {
|
if (fname[0]) {
|
||||||
base_name = (base_name ? base_name + 1 : fname);
|
base_name = (base_name ? base_name + 1 : fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,7 +738,7 @@ Display_XPMFile(
|
||||||
reset_debug = True;
|
reset_debug = True;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
PixelTableClear; /* force new pixel table now */
|
PixelTableClear(); /* force new pixel table now */
|
||||||
for (i=0; i<width; i++)
|
for (i=0; i<width; i++)
|
||||||
for (j=0; j<height; j++) {
|
for (j=0; j<height; j++) {
|
||||||
converted = False;
|
converted = False;
|
||||||
|
|
|
@ -2505,7 +2505,7 @@ ChangeTitle(void)
|
||||||
sprintf(dialogTitle, "%s - ", name);
|
sprintf(dialogTitle, "%s - ", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_fname && *last_fname)
|
if (*last_fname)
|
||||||
{
|
{
|
||||||
if (name = strrchr(last_fname, '/'))
|
if (name = strrchr(last_fname, '/'))
|
||||||
name++;
|
name++;
|
||||||
|
|
|
@ -626,7 +626,7 @@ callCancels( void )
|
||||||
XtCallCallbacks(style.startupDialog, XmNcallback, &CancelBut);
|
XtCallCallbacks(style.startupDialog, XmNcallback, &CancelBut);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dialogStates)
|
if (dialogStates[0])
|
||||||
_DtAddToResource(style.display, dialogStates);
|
_DtAddToResource(style.display, dialogStates);
|
||||||
|
|
||||||
calledAlready = True;
|
calledAlready = True;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue