dtappbuilder: Resolve all compiler warnings

This commit is contained in:
Peter Howkins
2018-04-24 21:55:56 +01:00
parent ee4c38da0a
commit 4007d3a460
79 changed files with 312 additions and 257 deletions

View File

@@ -49,6 +49,7 @@
#include <assert.h> /* assert() */
#include <stdio.h> /* FILE*, BUFSIZ */
#include <stdint.h>
#include <sys/param.h> /* MAXPATHLEN, ... */
#include <nl_types.h>
#include <X11/Intrinsic.h>
@@ -174,7 +175,7 @@ typedef CGenAnyData CGenData;
#define mfobj_set_module_data(_obj,_data) \
( mfobj_set_flags(_obj, CGenFlagDataIsModule), \
((int)(mfobj_data(_obj)->info.module = (_data))) \
((int)(intptr_t)(mfobj_data(_obj)->info.module = (_data))) \
)
#define mfobj_get_module_data(obj) \

View File

@@ -44,6 +44,7 @@
*/
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <Xm/Xm.h>
#include <Xm/XmStrDefs.h>
@@ -213,10 +214,10 @@ abmfP_args_init(void)
/* INT VALUES */
#define dump_int_resource(inst,name,value) \
(wroteResource = TRUE, \
fprintf(fp,"%s.%s:\t%d\n", inst, name, value))
fprintf(fp,"%s.%s:\t%d\n", inst, name, (int)(intptr_t)value))
#define write_int_resource(name,value) \
(wroteResource = TRUE, abio_printf(fp,"%s, %d", name, (int)(value)))
(wroteResource = TRUE, abio_printf(fp,"%s, %d", name, (int)(intptr_t)(value)))
/* STRING values */
#define dump_str_resource(inst,name,value) \

View File

@@ -644,53 +644,53 @@ write_define_display_var(GenCodeInfo genCodeInfo)
/*
* var: Drawable drawable = NULL;
* var: Drawable drawable = 0;
*/
static int
write_define_drawable_var(GenCodeInfo genCodeInfo)
{
make_istr_var_name(varDrawable, "drawable");
write_define_var(genCodeInfo, &abmfP_drawable_var(genCodeInfo),
"Drawable", varDrawable, abmfP_str_null);
"Drawable", varDrawable, abmfP_str_zero);
return 0;
}
/*
* var: Pixmap icon_pixmap = NULL;
* var: Pixmap icon_pixmap = 0;
*/
static int
write_define_icon_pixmap_var(GenCodeInfo genCodeInfo)
{
make_istr_var_name(varIconPixmap, "icon_pixmap");
write_define_var(genCodeInfo, &abmfP_icon_pixmap_var(genCodeInfo),
"Pixmap", varIconPixmap, abmfP_str_null);
"Pixmap", varIconPixmap, abmfP_str_zero);
return 0;
}
/*
* var: Pixmap icon_mask_pixmap = NULL;
* var: Pixmap icon_mask_pixmap = 0;
*/
static int
write_define_icon_mask_pixmap_var(GenCodeInfo genCodeInfo)
{
make_istr_var_name(varIconPixmap, "icon_mask_pixmap");
write_define_var(genCodeInfo, &abmfP_icon_mask_pixmap_var(genCodeInfo),
"Pixmap", varIconPixmap, abmfP_str_null);
"Pixmap", varIconPixmap, abmfP_str_zero);
return 0;
}
/*
* var: Pixmap label_pixmap = NULL;
* var: Pixmap label_pixmap = 0;
*/
static int
write_define_label_pixmap_var(GenCodeInfo genCodeInfo)
{
make_istr_var_name(varLabelPixmap, "label_pixmap");
write_define_var(genCodeInfo, &abmfP_label_pixmap_var(genCodeInfo),
"Pixmap", varLabelPixmap, abmfP_str_null);
"Pixmap", varLabelPixmap, abmfP_str_zero);
return 0;
}

View File

@@ -190,7 +190,7 @@ write_assign_local_vars_for_icon(GenCodeInfo genCodeInfo, ABObj obj)
else
*/
{
sprintf(parentName, abmfP_get_widget_parent_name(genCodeInfo, obj));
sprintf(parentName, "%s", abmfP_get_widget_parent_name(genCodeInfo, obj));
}
}

View File

@@ -264,11 +264,11 @@ static LibFuncRec abmfP_lrc_set_label_pixmaps =
" * Set the approriate resources.\n"
" */\n"
" XtVaSetValues(widget, XmNlabelType, XmPIXMAP, NULL);\n"
" if (labelPixmap != NULL)\n"
" if (labelPixmap != 0)\n"
" {\n"
" XtVaSetValues(widget, XmNlabelPixmap, labelPixmap, NULL);\n"
" }\n"
" if (labelInsensitivePixmap != NULL)\n"
" if (labelInsensitivePixmap != 0)\n"
" {\n"
" XtVaSetValues(widget, XmNlabelInsensitivePixmap, \n"
" labelInsensitivePixmap, NULL);\n"
@@ -952,8 +952,8 @@ static LibFuncRec abmfP_lrc_help_dispatch =
" ** Checking the status of the more-help info also lets us decide whether\n"
" ** the \"More...\" button should be enabled on the dialog.\n"
" */\n"
" if( help_data->help_volume ==0 || *(help_data->help_volume) == NULL ||\n"
" help_data->help_locationID ==0 || *(help_data->help_locationID)== NULL){\n"
" if( help_data->help_volume ==0 || *(help_data->help_volume) == 0 ||\n"
" help_data->help_locationID ==0 || *(help_data->help_locationID)== 0){\n"
" buffer[0] = '\\0';\n"
" }\n"
" else {\n"
@@ -1075,7 +1075,7 @@ static LibFuncRec abmfP_lrc_help_back_hdlr =
" ** Parse the combined volume/locationID string. Disable the \"More...\"\n"
" ** button if there isn't any help info, and enable it if there is.\n"
" */\n"
" if( buffer == 0 || (*buffer == NULL) ||\n"
" if( buffer == 0 || (*buffer == 0) ||\n"
" (cp=strrchr(buffer,'/')) == (char *)NULL) {\n"
" XtSetSensitive(more_button,False);\n"
" }\n"

View File

@@ -1119,8 +1119,8 @@ dtb_help_dispatch(
** Checking the status of the more-help info also lets us decide whether
** the "More..." button should be enabled on the dialog.
*/
if( help_data->help_volume ==0 || *(help_data->help_volume) == NULL ||
help_data->help_locationID ==0 || *(help_data->help_locationID)== NULL){
if( help_data->help_volume ==0 || *(help_data->help_volume) == 0 ||
help_data->help_locationID ==0 || *(help_data->help_locationID)== 0){
buffer[0] = '\0';
}
else {

View File

@@ -950,6 +950,7 @@ abmfP_write_stubs_c_file(
* Write includes.
*/
strcpy(moduleHeaderFileName, abmfP_get_ui_header_file_name(module));
abmfP_write_c_system_include(genCodeInfo, "stdint.h");
abmfP_write_c_system_include(genCodeInfo, "stdio.h");
abmfP_write_c_system_include(genCodeInfo, "Xm/Xm.h");
abmfP_write_c_local_include(genCodeInfo,

View File

@@ -74,20 +74,20 @@ static int write_func_def_params(
** **
**************************************************************************/
extern STRING abmfP_str_bool= "Boolean";
extern STRING abmfP_str_int= "int";
extern STRING abmfP_str_string= "String";
extern STRING abmfP_str_void= "void";
extern STRING abmfP_str_widget = "Widget";
extern STRING abmfP_str_xtpointer = "XtPointer";
extern STRING abmfP_str_tt_msg= "Tt_message";
extern STRING abmfP_str_voidpointer= "void *";
extern STRING abmfP_str_intpointer= "int *";
extern STRING abmfP_str_argvpointer= "char ***";
STRING abmfP_str_bool= "Boolean";
STRING abmfP_str_int= "int";
STRING abmfP_str_string= "String";
STRING abmfP_str_void= "void";
STRING abmfP_str_widget = "Widget";
STRING abmfP_str_xtpointer = "XtPointer";
STRING abmfP_str_tt_msg= "Tt_message";
STRING abmfP_str_voidpointer= "void *";
STRING abmfP_str_intpointer= "int *";
STRING abmfP_str_argvpointer= "char ***";
extern STRING abmfP_str_empty = "";
extern STRING abmfP_str_null = "NULL";
extern STRING abmfP_str_zero = "0";
STRING abmfP_str_empty = "";
STRING abmfP_str_null = "NULL";
STRING abmfP_str_zero = "0";
/*************************************************************************