delint compiler warnings

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@219 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1997-12-01 07:11:44 +00:00
parent 3d62f5db4f
commit 3acb520a82
22 changed files with 67 additions and 74 deletions

View File

@ -43,6 +43,8 @@
#include "AccountMenu.h"
#include "Data.h"
#include "main.h"
#include "MainWindow.h"
#include "RegWindow.h"
#include "TextBox.h"
#include "util.h"
@ -129,7 +131,7 @@ accWindow( Widget parent )
XmNmaxHeight, 340,
XmNresizable, FALSE,
XmNallowShellResize, FALSE,
/* XmNtransient, FALSE, /* allow window to be repositioned */
/* XmNtransient, FALSE, */ /* allow window to be repositioned */
NULL );
XtAddCallback( dialog, XmNdestroyCallback,
@ -633,7 +635,7 @@ editNotesCB( Widget mw, XtPointer cd, XtPointer cb )
static void
createCB( Widget mw, XtPointer cd, XtPointer cb )
{
int i, num, acc_id;
int i;
Transaction *trans;
Account *acc, *parent_acc;
AccWindow *accData = (AccWindow *)cd;
@ -737,7 +739,7 @@ finishEditCB( Widget mw, XtPointer cd, XtPointer cb )
static void
selectAccountCB( Widget mw, XtPointer cd, XtPointer cb )
{
int i, but;
int i, but=0;
Boolean set;
AccWindow *menu = (AccWindow *) cd;
Account *acc = (Account *) cb;

View File

@ -200,7 +200,7 @@ removeTransaction( Account *acc, int num )
Transaction **oldTrans;
int i,j;
if (NULL == acc) return;
if (NULL == acc) return NULL;
oldTrans = acc->transaction;
@ -357,8 +357,6 @@ insertTransaction( Account *acc, Transaction *trans )
Account *
xaccGetOtherAccount( Account *acc, Transaction *trans )
{
struct _account * _acc = (struct _account *) acc;
if (NULL == acc) return NULL;
if (acc == ((Account *) trans->debit)) {
@ -403,7 +401,7 @@ double xaccGetShareAmount (Account *acc, Transaction *trans)
} else {
printf ("Internal Error: xaccGetShareAmount: missing double entry \n");
printf ("this error should not occur. Please report the problem. \n");
printf ("acc=0x%x deb=0x%x cred=0x%x\n", acc, trans->debit, trans->credit);
printf ("acc=%p deb=%p cred=%p\n", acc, trans->debit, trans->credit);
themount = 0.0; /* punt */
}
return themount;
@ -538,7 +536,7 @@ xaccRecomputeBalance( Account * acc )
double share_balance = 0.0;
double share_cleared_balance = 0.0;
double amt = 0.0;
Transaction *trans, *last_trans;
Transaction *trans, *last_trans=NULL;
Account *tracc;
if( NULL == acc ) return;

View File

@ -255,7 +255,6 @@ xaccBuildAccountMenu (AccountGroup *grp, Widget parent, char * label)
Widget bar_widget;
MenuItem *menuList;
AccountMenu *accData;
XmString labelStr;
int i;
int offset = 0;
int nacc;

View File

@ -37,6 +37,8 @@
#include "date.h"
#include "main.h"
#include "MainWindow.h"
#include "RegWindow.h"
#include "RecnWindow.h"
#include "util.h"
/** GLOBALS *********************************************************/
@ -129,7 +131,7 @@ adjBWindow( Widget parent, Account *acc )
NULL );
todaysDate(&date);
sprintf(buf,"%2d/%2d/%4d\0", date.month, date.day, date.year);
sprintf(buf,"%2d/%2d/%4d", date.month, date.day, date.year);
adjBData->date =
XtVaCreateManagedWidget( "text",

View File

@ -80,10 +80,10 @@ Widget BuildMenu( Widget parent, int menu_type, char *menu_title,
MenuItem *items)
{
Widget menu,
cascade,
cascade=0,
widget,
first_menuitem,
initial_choice;
first_menuitem=0,
initial_choice=0;
int i;
XmString str;

View File

@ -111,7 +111,7 @@ xaccAccountGroupNotSaved (AccountGroup *grp)
int not_saved;
int i;
if (!grp) return;
if (!grp) return 0;
if (False == grp->saved) return 1;
for (i=0; i<grp->numAcc; i++) {
@ -144,7 +144,6 @@ getAccount( AccountGroup *grp, int num )
int
xaccGetNumAccounts ( AccountGroup *root )
{
Account *acc;
int num_acc = 0;
int i;
@ -197,7 +196,7 @@ xaccGetAccountRoot (Account * acc)
{
Account *parent_acc;
AccountGroup * grp;
AccountGroup * root;
AccountGroup * root = NULL;
/* find the root of the account group structure */
grp = (AccountGroup *) acc->parent;
@ -221,7 +220,6 @@ xaccGetPeerAccountFromID ( Account *acc, int acc_id )
{
AccountGroup * root;
Account *peer_acc;
int i;
if (NULL == acc) return NULL;
if (-1 >= acc_id) return NULL;
@ -273,7 +271,6 @@ xaccGetPeerAccountFromName ( Account *acc, char * name )
{
AccountGroup * root;
Account *peer_acc;
int i;
if (NULL == acc) return NULL;
if (NULL == name) return NULL;

View File

@ -34,8 +34,7 @@
void
xaccAccountWindowDestroy (Account *acc)
{
int nacc;
int i, n;
int i;
if (!acc) return;

View File

@ -56,9 +56,9 @@ void fileBoxCB( Widget mw, XtPointer cd, XtPointer cb );
char *
fileBox( Widget parent, int type, char * filter)
{
Widget dialog;
Widget dialog=0;
char* fileName = NULL;
XmString filterpattern, dialogname;
XmString filterpattern, dialogname=NULL;
if( !done )
return NULL; /* Don't open if there already is

View File

@ -77,6 +77,7 @@
\********************************************************************/
#include <fcntl.h>
#include <unistd.h>
#include <Xm/Xm.h>
#include "config.h"
@ -182,10 +183,8 @@ AccountGroup *
readData( char *datafile )
{
int fd;
int numAcc;
int err=0;
int token=0;
int i;
int num_unclaimed;
AccountGroup *grp = 0x0;

View File

@ -191,6 +191,15 @@ void xaccJumpToLabel (Widget mw, char *jumpfile);
#endif
#if HAVE_XPM
struct _image_info {
int width;
int height;
int num_colors;
Pixmap pixmap;
};
typedef struct _image_info ImageInfo;
ImageInfo *htmlResolveImage( Widget wm, char *file, int nl );
#endif
@ -599,7 +608,7 @@ htmlResolveImage( Widget mw, char *file, int nl )
ImageInfo *img = (ImageInfo *)malloc(sizeof(ImageInfo));
XpmImage xpm;
XpmAttributes attr;
int err,i;
int err;
char filename[BUFSIZE];
sprintf( (char *)&filename, "%s/%s", helpPath, file );
@ -613,10 +622,10 @@ htmlResolveImage( Widget mw, char *file, int nl )
img->width = xpm.width;
img->height = xpm.height;
img->num_colors = xpm.ncolors;
img->image_data = None;
img->pixmap = None;
err = XpmCreatePixmapFromXpmImage( XtDisplay(mw), XtWindow(mw), &xpm,
&(img->image), NULL, NULL );
&(img->pixmap), NULL, NULL );
if( err != 0 )
ERROR();

View File

@ -66,7 +66,6 @@ Account ** accListCopy (Account **list)
Transaction ** accListGetSortedTrans (Account **list)
{
Account *acc;
Transaction *trans;
Transaction **tarray;
int nacc = 0;
int ntrans = 0;
@ -115,7 +114,8 @@ Transaction ** accListGetSortedTrans (Account **list)
}
/* run the sort routine on the array */
qsort (tarray, ntrans, sizeof (Transaction *), xaccTransOrder);
qsort (tarray, ntrans, sizeof (Transaction *),
(int(*)(const void*, const void *)) xaccTransOrder);
return tarray;
}
@ -128,7 +128,7 @@ xaccGroupToList (Account *acc)
int nacc;
int i, n;
if (!acc) return;
if (!acc) return NULL;
nacc = xaccGetNumAccounts (acc->children);
nacc ++; /* add one for this account */

View File

@ -51,6 +51,7 @@
#include "MainWindow.h"
#include "RecnWindow.h"
#include "RegWindow.h"
#include "Reports.h"
#include "util.h"
#include "XferWindow.h"
@ -109,7 +110,6 @@ xaccMainWindowAddAcct (Widget acctrix, AccountGroup *grp, int depth )
for( i=0; i<grp->numAcc; i++ )
{
String cols[XACC_MAIN_NUM_COLS];
Transaction *trans=NULL;
Account *acc = getAccount( grp, i );
double dbalance;
@ -141,9 +141,9 @@ xaccMainWindowAddAcct (Widget acctrix, AccountGroup *grp, int depth )
dbalance = -dbalance;
}
if( 0.0 > dbalance )
sprintf( buf,"-$%.2f\0", DABS(dbalance) );
sprintf( buf,"-$%.2f", DABS(dbalance) );
else
sprintf( buf,"$%.2f\0", DABS(dbalance) );
sprintf( buf,"$%.2f", DABS(dbalance) );
cols[XACC_MAIN_ACC_BALN] = XtNewString(buf);
XtVaGetValues (acctrix, XmNrows, &currow, NULL);
@ -226,7 +226,7 @@ refreshMainWindow( void )
{
int nrows;
int row_from_top;
int row_from_top = 0;
AccountGroup *grp = topgroup; /* hack -- should pass as argument ... */
/* During refresh, we remove and re-add all displayed accounts.
@ -311,7 +311,6 @@ ArrowEventCallback(Widget w, XtPointer pClientData,
XEvent *event, Boolean *ContDispatch)
{
Account *acc = (Account *) pClientData;
XButtonEvent *bev = (XButtonEvent *) event;
XmArrowButtonCallbackStruct many;
@ -344,7 +343,6 @@ expandListCB( Widget mw, XtPointer pClientData, XtPointer cb)
{
XmAnyCallbackStruct *info = (XmAnyCallbackStruct *) cb;
Account *acc = (Account *)pClientData;
int i, nrows;
/* a "fix" to avoid double invocation */
switch ( info->reason ) {
@ -418,7 +416,7 @@ mainWindow( Widget parent )
NULL, NULL, (MenuItem *)NULL },
{ "Quit", &xmPushButtonWidgetClass, 'Q', NULL, NULL, True,
fileMenubarCB, (XtPointer)FMB_QUIT, (MenuItem *)NULL },
NULL,
{ NULL, },
};
MenuItem accountMenu[] = {
@ -442,7 +440,7 @@ mainWindow( Widget parent )
{ "Edit Categories...", &xmPushButtonWidgetClass, 'C', NULL, NULL, True,
accountMenubarCB, (XtPointer)AMB_CAT, (MenuItem *)NULL },
#endif
NULL,
{ NULL, },
};
MenuItem helpMenu[] = {
@ -456,7 +454,7 @@ mainWindow( Widget parent )
NULL, NULL, (MenuItem *)NULL },
{ "License...", &xmPushButtonWidgetClass, 'L', NULL, NULL, True,
helpMenubarCB, (XtPointer)HMB_LIC, (MenuItem *)NULL },
NULL,
{ NULL, },
};
mainwindow = XtVaCreateManagedWidget( "mainwindow",
@ -808,7 +806,6 @@ listCB( Widget mw, XtPointer cd, XtPointer cb )
{
XbaeMatrixEnterCellCallbackStruct *cbs =
(XbaeMatrixEnterCellCallbackStruct *)cb;
int rows = XbaeMatrixNumRows(accountlist);
cbs->doit = False;
cbs->map = False;
@ -996,9 +993,6 @@ void
accountMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
{
int button = (int)cd;
int *posList;
int numPos;
AccountGroup *grp = topgroup;
/*
* which of the file menubar options was chosen
@ -1115,8 +1109,6 @@ void
helpMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
{
int button = (int)cd;
int *posList;
int numPos;
/*
* which of the file menubar options was chosen

View File

@ -50,7 +50,6 @@ PopBox *
popBox (Widget parent, int width, int drop_width)
{
Widget combobox;
XmString str;
PopBox *popData;
/* malloc the pop GUI structure */

View File

@ -35,6 +35,7 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <Xm/Xm.h>
#include "config.h"
@ -314,7 +315,6 @@ char * xaccReadQIFAccList (int fd, AccountGroup *grp, int cat)
*tok = ':';
if (parent) {
Account *preexisting;
/* trim off the parent account name ... */
/* tok += sizeof(char); leave behind the colon ... */

View File

@ -22,6 +22,7 @@
* Huntington Beach, CA 92648-4632 *
\********************************************************************/
#include <ctype.h>
#include <string.h>
#include "config.h"

View File

@ -119,13 +119,13 @@ recnRefresh( RecnWindow *recnData )
sprintf( buf, "%c", trans->reconciled );
rows[0] = XtNewString(buf);
rows[1] = trans->num;
sprintf( buf, "%2d/%2d/%02d\0",
sprintf( buf, "%2d/%2d/%02d",
trans->date.month,
trans->date.day,
(trans->date.year%100) );
rows[2] = XtNewString(buf);
rows[3] = trans->description;
sprintf( buf, "%.2f\0", DABS(themount) );
sprintf( buf, "%.2f", DABS(themount) );
rows[4] = XtNewString(buf);
if( 0.0 > themount)
@ -191,17 +191,17 @@ recnRecalculateBalance( RecnWindow *recnData )
}
/* Update the difference field, and the total fields */
sprintf( buf, " $ %.2f\0", DABS(ddebit) );
sprintf( buf, " $ %.2f", DABS(ddebit) );
XmTextSetString( recnData->totDebit, buf );
sprintf( buf, " $ %.2f\0", dcredit );
sprintf( buf, " $ %.2f", dcredit );
XmTextSetString( recnData->totCredit, buf );
ddiff = recnData->ddiff + dcredit + ddebit;
if( 0.0 > ddiff )
sprintf( buf, "-$ %.2f\0", DABS(ddiff) );
sprintf( buf, "-$ %.2f", DABS(ddiff) );
else
sprintf( buf, " $ %.2f\0", ddiff );
sprintf( buf, " $ %.2f", ddiff );
XmTextSetString( recnData->difference, buf );
}
@ -823,7 +823,6 @@ recnCB( Widget mw, XtPointer cd, XtPointer cb )
XbaeMatrixEnterCellCallbackStruct *cbs =
(XbaeMatrixEnterCellCallbackStruct *)cb;
int rows = XbaeMatrixNumRows(mw);
cbs->doit = False;
cbs->map = False;

View File

@ -77,7 +77,7 @@ typedef struct _RegWindow {
* transaction currEntry */
unsigned short currEntry; /* to keep track of last edited transaction*/
char type; /* register display type, usually equal to *
short type; /* register display type, usually equal to *
* account type */
char header_rows; /* number of header rows */
@ -1264,7 +1264,6 @@ regSaveTransaction( RegWindow *regData, int position )
if( regData->changed & MOD_MEMO )
{
String tmp;
String memo = NULL;
DEBUG("MOD_MEMO\n");
/* ... the memo ... */
XtFree( trans->memo );
@ -1685,7 +1684,7 @@ regWindowAccGroup( Widget parent, Account *acc )
default:
PERR (" regWindowAccGroup(): unknown account type \n");
_free (list);
return;
return NULL;
}
retval = regWindowLedger (parent, list, ledger_type);
acc->regLedger = retval;
@ -1706,7 +1705,6 @@ regWindowAccGroup( Widget parent, Account *acc )
RegWindow *
regWindowLedger( Widget parent, Account **acclist, int ledger_type )
{
Transaction *trans;
RegWindow *regData;
Widget menubar, pane, buttonform, frame, reg, widget;
int position=0;
@ -1723,7 +1721,7 @@ regWindowLedger( Widget parent, Account **acclist, int ledger_type )
MenuItem reportMenu[] = {
{ "Simple...", &xmPushButtonWidgetClass, 'S', NULL, NULL, True,
NULL, (XtPointer)0, (MenuItem *)NULL },
NULL,
{ NULL, },
};
MenuItem activityMenu[] = {
@ -1745,7 +1743,7 @@ regWindowLedger( Widget parent, Account **acclist, int ledger_type )
NULL, NULL, (MenuItem *)NULL },
{ "Close Window", &xmPushButtonWidgetClass, 'Q', NULL, NULL, True,
destroyShellCB, NULL, (MenuItem *)NULL },
NULL,
{ NULL, },
};
@ -1758,7 +1756,7 @@ regWindowLedger( Widget parent, Account **acclist, int ledger_type )
NULL, NULL, (MenuItem *)NULL },
{ "License...", &xmPushButtonWidgetClass, 'L', NULL, NULL, True,
helpMenubarCB, (XtPointer)HMB_LIC, (MenuItem *)NULL },
NULL,
{ NULL, },
};
@ -2749,8 +2747,8 @@ regCB( Widget mw, XtPointer cd, XtPointer cb )
regData->insert = mvcbs->verify->currInsert;
DEBUG("resyncing quickfill!\n");
DEBUGCMD(printf(" insert = %d\n currInsert = %d\n",
regData->insert,
mvcbs->verify->currInsert ));
(int) regData->insert,
(int) (mvcbs->verify->currInsert) ));
/* we are out of sync, which means that the user
* must have hit delete or something... to be on
* the safe side, rescan the description field,

View File

@ -46,8 +46,7 @@
void
simpleReportWindow( Widget parent )
{
Widget dialog, form, frame, rc, widget,
label, buttonform;
Widget dialog, form, frame, widget, buttonform;
setBusyCursor( parent );
/* force the size of the dialog so it is not resizable */

View File

@ -58,7 +58,6 @@ PopBox *
xferBox (Widget parent, AccountGroup *grp, int width, int drop_down_width)
{
PopBox *popGUI;
Account * acc;
popGUI = popBox (parent, width, drop_down_width);

View File

@ -38,6 +38,9 @@
#include "BuildMenu.h"
#include "Data.h"
#include "main.h"
#include "MainWindow.h"
#include "RecnWindow.h"
#include "RegWindow.h"
#include "util.h"
@ -81,7 +84,7 @@ xferWindow( Widget parent )
{
Date date;
char buf[BUFSIZE];
Widget dialog, form, widget, label, buttonform, menu;
Widget dialog, form, widget, label, buttonform;
MenuItem *accountMenu;
XferWindow *xferData;
int position,i;
@ -133,7 +136,7 @@ xferWindow( Widget parent )
NULL );
todaysDate(&date);
sprintf(buf,"%2d/%2d/%4d\0", date.month, date.day, date.year);
sprintf(buf,"%2d/%2d/%4d", date.month, date.day, date.year);
xferData->date =
XtVaCreateManagedWidget( "text",

View File

@ -32,7 +32,7 @@
#include "FileBox.h"
#include "FileIO.h"
#include "main.h"
#include "RegWindow.h"
#include "MainWindow.h"
#include "util.h"
/** PROTOTYPES ******************************************************/
@ -173,5 +173,7 @@ main( int argc, char *argv[] )
/* Enter event loop */
XtAppMainLoop(app);
return 0;
}

View File

@ -371,11 +371,7 @@ verifyBoxCB( Widget mw, XtPointer cd, XtPointer cb )
void
errorBox( Widget parent, char *message )
{
Widget dialog,
pane,
controlform,
actionform,
widget;
Widget dialog;
if( message != NULL )
{