Resolve many build warnings

This patch fixes many warnings from the beginning of the build up to
and including the depend stage. Nearly all warnings should be gone
even with -Wall.
This commit is contained in:
Ulrich Wilkens
2014-09-23 23:16:35 +02:00
committed by Jon Trulson
parent 2bf29e5d63
commit 42e891d9e7
125 changed files with 1926 additions and 1440 deletions

View File

@@ -231,5 +231,3 @@ DYNAMIC =
XCOMM Variables to switch on debug mode temporarily
XCOMM CDEBUGFLAGS = -g -DDEBUG
XCOMM CXXDEBUGFLAGS = -g -DDEBUG
DependTarget()

View File

@@ -270,7 +270,7 @@ __bt_split(t, sp, key, data, flags, ilen, skip)
rchild->pgno, bl->flags & P_BIGKEY);
memmove(dest, bl->bytes, nksize ? nksize : bl->ksize);
if (bl->flags & P_BIGKEY &&
bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR)
bt_preserve(t, *(char *)bl->bytes) == RET_ERROR)
goto err1;
break;
case P_RINTERNAL:
@@ -590,7 +590,7 @@ bt_broot(t, h, l, r)
* so it isn't deleted when the leaf copy of the key is deleted.
*/
if (bl->flags & P_BIGKEY &&
bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR)
bt_preserve(t, *(char *)bl->bytes) == RET_ERROR)
return (RET_ERROR);
break;
case P_BINTERNAL:

View File

@@ -114,8 +114,8 @@ mpool_open(key, fd, pagesize, maxcache)
if ((mp = malloc(sizeof(MPOOL))) == NULL)
return (NULL);
mp->free.cnext = mp->free.cprev = (BKT *)&mp->free;
mp->lru.cnext = mp->lru.cprev = (BKT *)&mp->lru;
mp->free.cnext = mp->free.cprev = (BKT *)(void *)&mp->free;
mp->lru.cnext = mp->lru.cprev = (BKT *)(void *)&mp->lru;
for (entry = 0; entry < HASHSIZE; ++entry)
mp->hashtable[entry].hnext = mp->hashtable[entry].hprev =
mp->hashtable[entry].cnext = mp->hashtable[entry].cprev =
@@ -322,7 +322,7 @@ mpool_close(mp)
BKT *b, *next;
/* Free up any space allocated to the lru pages. */
for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = next) {
for (b = mp->lru.cprev; b != (BKT *)(void *)&mp->lru; b = next) {
next = b->cprev;
free(b);
}
@@ -345,7 +345,7 @@ mpool_sync(mp)
{
BKT *b;
for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = b->cprev)
for (b = mp->lru.cprev; b != (BKT *)(void *)&mp->lru; b = b->cprev)
if (b->flags & MPOOL_DIRTY && mpool_write(mp, b) == RET_ERROR)
return (RET_ERROR);
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
@@ -375,7 +375,7 @@ mpool_bkt(mp)
* any lists. If we don't find anything we grow the cache anyway.
* The cache never shrinks.
*/
for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = b->cprev)
for (b = mp->lru.cprev; b != (BKT *)(void *)&mp->lru; b = b->cprev)
if (!(b->flags & MPOOL_PINNED)) {
if (b->flags & MPOOL_DIRTY &&
mpool_write(mp, b) == RET_ERROR)

View File

@@ -137,7 +137,7 @@ typedef struct MPOOL {
}
#define inschain(bp, dp) { \
(bp)->cnext = (dp)->cnext; \
(bp)->cprev = (struct BKT *)(dp); \
(bp)->cprev = (struct BKT *)(void *)(dp); \
(dp)->cnext->cprev = (bp); \
(dp)->cnext = (bp); \
}

View File

@@ -277,7 +277,7 @@ Boolean data_t::binaryIn(buffer& buf)
break;
}
buf.get(*(long*)&dt);
buf.get(*(char*)&dt);
return true;
}

View File

@@ -475,7 +475,7 @@ IcccmAgent::convert_handler(Widget w, Atom selection, Atom target,
unsigned long xmu_length;
XmuConvertStandardSelection(w, req->time, &selection, &target, &type_return,
(caddr_t*)&xmu_targets, &xmu_length,
(caddr_t*)(void*)&xmu_targets, &xmu_length,
&format_return);
assert( type_return == XA_ATOM );
assert( format_return == sizeof(Atom) * 8 );

View File

@@ -3041,7 +3041,7 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark)
{
char *name;
_DtCanvasGetSelection(f_help_dsp_area->canvas,
_DtCvSELECTED_TEXT, ((_DtCvPointer *)&name));
_DtCvSELECTED_TEXT, ((_DtCvPointer *)(void*)&name));
#ifdef BOOKMARK_DEBUG
cerr << "Bookmark Name: [" << name << "]" << endl;

View File

@@ -850,7 +850,7 @@ locale_of_desktop()
1L, 1L, False,
_DT_SM_WINDOW_INFO,
&type, &format, &nitems, &after,
(unsigned char **)&sm_prop_window) ;
(unsigned char **)(void*)&sm_prop_window) ;
#ifdef DEBUG
// property.smWindow = (unsigned long) smGD.topLevelWindow;
@@ -870,7 +870,7 @@ locale_of_desktop()
0L, (long)8, False,
XA_STRING,
&type, &format, &nitems, &after,
(unsigned char **)&dt_locale) ;
(unsigned char **)(void*)&dt_locale) ;
#ifdef DEBUG
printf( "desktop's locale is %s\n", dt_locale ) ;

View File

@@ -45,29 +45,30 @@ EXTRA_INCLUDES=-I/X11/include
OBJS1= cgmcmds.o \
cgmcommon.o \
cgmio.o \
cgmtext.o \
getcgm.o
cgmtext.o
SRCS1= cgmcmds.c \
cgmcommon.c \
cgmio.c \
cgmtext.c \
getcgm.c
cgmtext.c
SRCS2= getcgm.c
OBJS2= getcgm.o
NormalCplusplusObjectRule()
NormalLibraryObjectRule()
NormalLibraryTarget(cgm, $(OBJS1))
NormalLibraryTarget2(cgm, $(OBJS1), $(OBJS2))
AllTarget($(PROGRAMS))
SRCS2 = testcgm.c
OBJS2 = testcgm.o
SRCS3 = testcgm.c
OBJS3 = testcgm.o
ComplexProgramTarget_2($(PROGRAMS),$(LOCAL_LIBRARIES),$(SYS_LIBRARIES))
ComplexProgramTarget_3($(PROGRAMS),$(LOCAL_LIBRARIES),$(SYS_LIBRARIES))
DependTarget3($(SRCS1),$(SRCS2),NullParameter)
DependTarget3($(SRCS1),$(SRCS2),$(SRCS3))
clean::
RemoveFiles($(PROGRAMS))

View File

@@ -56,7 +56,11 @@ extern void get_type ();
const int GR_ENCODING_TEXT = 1;
//-------------------------------------------------------------------------
#if __GNUC__ == 4 && __GNUC_MINOR__ == 4
GR_TYPE __attribute__((optimize("O0")))
#else
GR_TYPE
#endif
GraphicsTask::graphics_type( const char *gname )
{
@@ -90,7 +94,7 @@ GraphicsTask::graphics_type( const char *gname )
form("cannot reopen graphics file %s\n", gname)));
}
hdrptr = (XWDFileHeader *)header;
hdrptr = (XWDFileHeader *)(void*)header;
// Initialize the structure
for (CARD32 ndx = 0; ndx < sz_XWDheader; ndx++) {
header[ndx] = (CARD32) 0;

View File

@@ -251,5 +251,3 @@ clean::
$(RM) libMMDBTemplates.a
ptclean
#endif
DependTarget()

View File

@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
main(argc, argv)
int main(argc, argv)
int argc ;
char **argv;
{

View File

@@ -400,7 +400,9 @@ static int yy_did_buffer_switch_on_eof;
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
#if 0
static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
#endif
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
@@ -410,11 +412,13 @@ void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
#define yy_new_buffer yy_create_buffer
#if 0
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif
YY_DECL
{
@@ -876,7 +880,7 @@ register yy_state_type yy_current_state;
return ( yy_is_jam ? 0 : yy_current_state );
}
#if 0
#ifdef YY_USE_PROTOS
static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
#else
@@ -920,8 +924,10 @@ register YY_CHAR *yy_bp;
*/
YY_DO_BEFORE_ACTION; /* set up yytext again */
}
#endif
#if 0
#ifdef __cplusplus
static int yyinput()
#else
@@ -988,6 +994,7 @@ static int input()
return ( c );
}
#endif
#ifdef YY_USE_PROTOS

View File

@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
main(argc, argv)
int main(argc, argv)
int argc ;
char **argv ;
{