1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Silence lots of warnings in lib/DtHelp.

* 64bit warnings
* Missing prototypes
* explicit parentheses / brackets

There's still some work to be done, but, as always, it's a start ...
This commit is contained in:
Pascal Stumpf 2013-07-22 18:44:04 +02:00 committed by Jon Trulson
parent 0c165f56f5
commit 7e0a9517e3
65 changed files with 259 additions and 152 deletions

View file

@ -39,8 +39,26 @@ extern void _XmBulletinBoardSizeUpdate(
extern void _XmBulletinBoardSetDynDefaultButton(
Widget wid,
Widget newDefaultButton) ;
/* Extracted from GeoUtilsI.h */
extern Boolean _XmGeoSetupKid(
XmKidGeometry geo,
Widget kidWid) ;
/* Extracted from IconFileP.h */
extern void XmeFlushIconFileCache(String path);
/* Extracted from ImageCachI.h */
extern void _XmPutScaledImage (
Display* display ,
Drawable d ,
GC gc ,
XImage* src_image ,
int src_x ,
int src_y ,
int dest_x ,
int dest_y ,
unsigned int src_width ,
unsigned int src_height,
unsigned int dest_width ,
unsigned int dest_height);
/* Extracted from ManagerI.h */
extern void _XmManagerHelp(
Widget wid,

View file

@ -69,4 +69,6 @@ function proto() {
/_XmBulletinBoardSetDynDefaultButton/ { proto(); }
/_XmBulletinBoardSizeUpdate/ { proto(); }
/_XmManagerHelp/ { proto(); }
/_XmPutScaledImage/ { proto(); }
/_XmGeoSetupKid/ { proto(); }
/XmeFlushIconFileCache/ { proto(); }

View file

@ -45,6 +45,7 @@
/*
* system includes
*/
#include <stdlib.h>
#include <Xm/Xm.h>
/*

View file

@ -72,6 +72,8 @@ extern int errno;
#include "CCDFUtilI.h"
#include "FontAttrI.h"
#include "CvStringI.h"
#include "FormatUtilI.h"
#include "StringFuncsI.h"
#ifdef NLS16
#endif

View file

@ -57,6 +57,7 @@
#include <Xm/AtomMgr.h>
#include <Xm/DrawnB.h>
#include <Xm/CutPaste.h>
#include <Xm/XmPrivate.h>
/*
@ -67,6 +68,7 @@
/*
* private includes
*/
#include "Access.h"
#include "DisplayAreaP.h"
#include "CallbacksI.h"
#include "FontI.h"

View file

@ -61,6 +61,7 @@
#include "CvStringI.h"
#include "LinkMgrI.h"
#include "LayoutUtilI.h"
#include "SelectionI.h"
#include "VirtFuncsI.h"
#ifdef NLS16
@ -144,7 +145,7 @@ static _DtCanvasStruct DefaultCanvas =
NULL, /* _DtCvMarkData *marks; */
NULL, /* searchs */
NULL, /* pg_breaks */
NULL, /* _DtCvVirtualInfo virt_functions; */
{ NULL }, /* _DtCvVirtualInfo virt_functions; */
};
/*****************************************************************************

View file

@ -130,7 +130,7 @@ typedef struct _dtCvSearchData {
typedef struct _dtCanvasStruct {
int error;
int txt_cnt; /* maximum used in txt_list */
long txt_cnt; /* maximum used in txt_list */
int txt_max; /* maximum in txt_list */
int line_cnt; /* maximum used in line_lst */

View file

@ -43,6 +43,7 @@
/*
* system includes
*/
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
@ -59,6 +60,7 @@
*/
#include "bufioI.h"
#include "CanvasOsI.h"
#include "FormatUtilI.h"
#ifdef NLS16
#endif

View file

@ -45,6 +45,7 @@
* system includes
*/
#include <stdlib.h>
#include <X11/Intrinsic.h>
/*
* Canvas Engine includes
@ -61,6 +62,7 @@
#include "FontAttrI.h"
#include "FormatUtilI.h"
#include "RegionI.h"
#include "StringFuncsI.h"
#include "XInterfaceI.h"
#ifdef NLS16

View file

@ -140,7 +140,7 @@ _DtHelpDisplayAreaDestroyCB (
XtPointer call_data)
{
int i;
int strIdx;
long strIdx;
XrmName xrmList[_DtHelpFontQuarkNumber];
Display *dpy;
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;

View file

@ -120,7 +120,7 @@ typedef struct _DtHelpDAfontInfo {
int max_sets; /* The max number of font_sets */
int struct_cnt; /* the cur number of font_structs */
int set_cnt; /* The cur number of font_sets */
int def_idx; /* The default index */
long def_idx; /* The default index */
} DtHelpDAFontInfo;
/*

View file

@ -40,6 +40,7 @@
**
********************************************************************
****************************<+>*************************************/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View file

@ -270,7 +270,7 @@ static XrmBinding FontBindings[_DtHelpFontQuarkNumber] =
{ XrmBindLoosely, XrmBindLoosely, XrmBindLoosely, XrmBindLoosely,
XrmBindLoosely, XrmBindLoosely, XrmBindLoosely };
static DtHelpDAFSMetrics DefaultMetrics = { FALSE, 0, 0 };
static DtHelpDAFSMetrics DefaultMetrics = { FALSE, { 0, 0 } };
static DtHelpDAFontInfo DefFontInfo = { NULL, NULL, NULL, NULL, NULL,
NULL, 0, NULL, 0, 0, 0, 0, 0};
@ -366,7 +366,7 @@ LoadFont (
Display *dpy,
DtHelpDAFontInfo *font_info,
char *font_string,
int *ret_index)
long *ret_index)
{
short found = False;
short colon = False;
@ -479,10 +479,10 @@ int
__DtHelpFontIndexGet (
DtHelpDispAreaStruct *pDAS,
XrmQuarkList xrm_list,
int *ret_idx)
long *ret_idx)
{
int result = -1;
int fontIndex = pDAS->font_info.def_idx;
long fontIndex = pDAS->font_info.def_idx;
XrmRepresentation retType;
XrmValue retValue;
char buffer[10];
@ -541,7 +541,7 @@ __DtHelpFontIndexGet (
/*
* remember the character set for this font.
*/
sprintf (buffer, "%d", fontIndex);
sprintf (buffer, "%ld", fontIndex);
retValue.size = sizeof (XrmQuark);
retValue.addr = (XtPointer) &xrm_list[_DT_HELP_FONT_CHAR_SET];
xrmList[0] = XrmStringToQuark (buffer);
@ -581,7 +581,7 @@ __DtHelpFontIndexGet (
int
__DtHelpFontCharSetQuarkGet (
DtHelpDispAreaStruct *pDAS,
int font_index,
long font_index,
XrmQuark *ret_quark )
{
XrmRepresentation retType;
@ -593,7 +593,7 @@ __DtHelpFontCharSetQuarkGet (
/*
* quarkize the font index
*/
sprintf (buffer, "%d", font_index);
sprintf (buffer, "%ld", font_index);
xrmList[0] = XrmStringToQuark (buffer);
xrmList[1] = XrmStringToQuark ("code_set");
xrmList[2] = 0;
@ -625,7 +625,7 @@ __DtHelpFontCharSetQuarkGet (
int
__DtHelpFontLangQuarkGet (
DtHelpDispAreaStruct *pDAS,
int font_index,
long font_index,
XrmQuark *ret_quark )
{
XrmRepresentation retType;
@ -637,7 +637,7 @@ __DtHelpFontLangQuarkGet (
/*
* quarkize the font index
*/
sprintf (buffer, "%d", font_index);
sprintf (buffer, "%ld", font_index);
xrmList[0] = XrmStringToQuark (buffer);
xrmList[1] = XrmStringToQuark ("language");
xrmList[2] = 0;
@ -814,7 +814,7 @@ __DtHelpFontDatabaseInit (
}
/******************************************************************************
* Function: XFontStruct *__DtHelpFontStructGet (int font_index );
* Function: XFontStruct *__DtHelpFontStructGet (long font_index );
*
* Parameters: font_index Specifies an index into the Font Structure
* List.
@ -827,7 +827,7 @@ __DtHelpFontDatabaseInit (
XFontStruct *
__DtHelpFontStructGet (
DtHelpDAFontInfo font_info,
int font_index)
long font_index)
{
if (font_index > -1 && font_index < font_info.struct_cnt)
@ -837,7 +837,7 @@ __DtHelpFontStructGet (
}
/******************************************************************************
* Function: XFontSet __DtHelpFontSetGet (int font_index);
* Function: XFontSet __DtHelpFontSetGet (long font_index);
*
* Parameters: font_index Specifies an index into the Font Set List.
*
@ -849,7 +849,7 @@ __DtHelpFontStructGet (
XFontSet
__DtHelpFontSetGet (
DtHelpDAFontInfo font_info,
int font_index)
long font_index)
{
if (font_index < 0)
@ -864,7 +864,7 @@ __DtHelpFontSetGet (
}
/******************************************************************************
* Function: int __DtHelpDefaultFontIndexGet ();
* Function: long __DtHelpDefaultFontIndexGet ();
*
* Parameters:
*
@ -873,7 +873,7 @@ __DtHelpFontSetGet (
* Purpose:
*
*****************************************************************************/
int
long
__DtHelpDefaultFontIndexGet (
DtHelpDispAreaStruct *pDAS)
{
@ -894,7 +894,7 @@ __DtHelpDefaultFontIndexGet (
void
__DtHelpFontMetrics (
DtHelpDAFontInfo font_info,
int font_index,
long font_index,
_DtCvUnit *ret_ascent,
_DtCvUnit *ret_descent,
_DtCvUnit *ret_char_width,
@ -983,11 +983,11 @@ _DtHelpGetExactFontIndex (
const char *lang,
const char *char_set,
char *xlfd_spec,
int *ret_idx)
long *ret_idx)
{
int i = 0;
int result = -1;
int fontIndex = pDAS->font_info.def_idx;
long fontIndex = pDAS->font_info.def_idx;
char **nameList;
DtHelpDAFontInfo *fontInfo = &(pDAS->font_info);
Display *dpy = XtDisplay(pDAS->dispWid);
@ -1048,7 +1048,7 @@ _DtHelpGetExactFontIndex (
* remember the character set for this font.
*/
myQuark = XrmStringToQuark(char_set);
sprintf (buffer, "%d", fontIndex);
sprintf (buffer, "%ld", fontIndex);
retValue.size = sizeof (XrmQuark);
retValue.addr = (XtPointer) &myQuark;
xrmList[0] = XrmStringToQuark (buffer);

View file

@ -78,12 +78,12 @@ extern "C" {
* Semi Public Routines
****************************************************************************/
extern void _DtHelpCopyDefaultList(XrmName *xrm_list);
extern int __DtHelpDefaultFontIndexGet (
extern long __DtHelpDefaultFontIndexGet (
DtHelpDispAreaStruct *pDAS);
extern void _DtHelpGetStringQuarks(XrmName *xrm_list);
extern int __DtHelpFontCharSetQuarkGet(
DtHelpDispAreaStruct *pDAS,
int font_index,
long font_index,
XrmQuark *ret_quark);
extern void __DtHelpFontDatabaseInit (
DtHelpDispAreaStruct *pDAS,
@ -93,14 +93,14 @@ extern void __DtHelpFontDatabaseInit (
extern int __DtHelpFontIndexGet (
DtHelpDispAreaStruct *pDAS,
XrmQuarkList xrm_list,
int *ret_idx);
long *ret_idx);
extern int __DtHelpFontLangQuarkGet(
DtHelpDispAreaStruct *pDAS,
int font_index,
long font_index,
XrmQuark *ret_quark);
extern void __DtHelpFontMetrics (
DtHelpDAFontInfo font_info,
int font_index,
long font_index,
_DtCvUnit *ret_ascent,
_DtCvUnit *ret_descent,
_DtCvUnit *ret_char_width,
@ -108,16 +108,16 @@ extern void __DtHelpFontMetrics (
_DtCvUnit *ret_sub);
extern XFontSet __DtHelpFontSetGet (
DtHelpDAFontInfo font_info,
int font_index );
long font_index );
extern XFontStruct *__DtHelpFontStructGet (
DtHelpDAFontInfo font_info,
int font_index);
long font_index);
extern int _DtHelpGetExactFontIndex(
DtHelpDispAreaStruct *pDAS,
const char *lang,
const char *char_set,
char *xlfd_spec,
int *ret_idx);
long *ret_idx);
#ifdef __cplusplus
}

View file

@ -83,10 +83,12 @@ extern int errno;
#include "Access.h"
#include "AccessP.h"
#include "AccessI.h"
#include "AccessCCDFI.h"
#include "SDLI.h"
#include "FormatUtilI.h"
#include "FormatCCDFI.h"
#include "FormatSDLI.h"
#include "StringFuncsI.h"
#ifdef NLS16
@ -135,10 +137,10 @@ FormatChunksToXmString(
{
int result = 0;
int i;
int j;
long j;
int quarkCount;
int chunkType;
int myIdx;
long chunkType;
long myIdx;
_DtCvPointer fontPtr;
char *charSet;
const char *strChunk;
@ -219,7 +221,7 @@ FormatChunksToXmString(
/*
* create a string for the char set and a quark for it.
*/
chunkType = (int) title_chunks[i++];
chunkType = (long) title_chunks[i++];
/*
* i now points to the first value after the type
@ -247,7 +249,7 @@ FormatChunksToXmString(
* resolve/load the font for the default fonts
*/
_DtHelpDAResolveFont(pDAS, lang, charSet, fontSpecs, &fontPtr);
myIdx = (int) fontPtr;
myIdx = (long) fontPtr;
if (lang != NULL)
{
charSet--;
@ -267,9 +269,9 @@ FormatChunksToXmString(
/*
* get the default font for the language and code set.
*/
(void) __DtHelpFontCharSetQuarkGet(pDAS, (int)title_chunks[i],
(void) __DtHelpFontCharSetQuarkGet(pDAS, (long)title_chunks[i],
&xrmName[_DT_HELP_FONT_CHAR_SET]);
(void) __DtHelpFontLangQuarkGet(pDAS, (int)title_chunks[i],
(void) __DtHelpFontLangQuarkGet(pDAS, (long)title_chunks[i],
&xrmName[_DT_HELP_FONT_LANG_TER]);
(void) __DtHelpFontIndexGet(pDAS, xrmName, &myIdx);
@ -284,23 +286,23 @@ FormatChunksToXmString(
*/
if (chunkType & DT_HELP_CE_SPC)
{
j = (int) title_chunks[i];
j = (long) title_chunks[i];
strChunk = _DtHelpDAGetSpcString(pDAS->spc_chars[j].spc_idx);
fontPtr = pDAS->spc_chars[j].font_ptr;
/*
* get the default font for the language and code set.
*/
(void) __DtHelpFontCharSetQuarkGet(pDAS, (int)fontPtr,
(void) __DtHelpFontCharSetQuarkGet(pDAS, (long)fontPtr,
&xrmName[_DT_HELP_FONT_CHAR_SET]);
(void) __DtHelpFontLangQuarkGet(pDAS, (int)fontPtr,
(void) __DtHelpFontLangQuarkGet(pDAS, (long)fontPtr,
&xrmName[_DT_HELP_FONT_LANG_TER]);
(void) __DtHelpFontIndexGet(pDAS, xrmName, &myIdx);
}
else /* if (chunkType & _DT_HELP_CE_STRING) */
strChunk = (char *) title_chunks[i];
sprintf(buffer, "%d", myIdx);
sprintf(buffer, "%ld", myIdx);
charSetQuark = XrmStringToQuark(buffer);
j = 0;

View file

@ -5206,7 +5206,7 @@ _DtHelpCeGetCcdfTitleChunks(
_FrmtUiInfo *ui_info,
void ***ret_chunks)
{
int type = 0;
long type = 0;
int result = 0;
int offset;
char *fileName;

View file

@ -100,5 +100,9 @@ extern int _DtHelpFormatVolumeTitle (
XmString *ret_title,
XmFontList *ret_list,
Boolean *ret_mod);
extern int _DtHelpGetAsciiVolumeTitle (
XtPointer client_data,
_DtHelpVolumeHdl volume,
char **ret_title);
#endif /* _DtHelpFormatI_h */

View file

@ -893,7 +893,7 @@ _DtHelpFormatManPage(
/*
* did we have any paragraphs to format?
*/
if (topic != NULL && NULL == topicStruct->seg_list
if ((topic != NULL && NULL == topicStruct->seg_list)
|| NULL == _DtCvContainerListOfSeg(topicStruct->seg_list))
{
_DtHelpFreeSegments(topicStruct->seg_list, _DtCvFALSE,

View file

@ -600,19 +600,21 @@ static FormatStruct DefFormatStruct =
SdlTypeDynamic, /* SdlOption sdl_type */
SdlWindowCurrent, /* SdlOption window; */
SdlInterpKsh, /* SdlOption interp; */
0, /* SDLNumber count/offset; */
{ 0 }, /* SDLNumber count/offset; */
NULL, /* SDLCdata language; */
NULL, /* SDLCdata char_set; */
NULL, /* SDLCdata id; */
NULL, /* SDLCdata elstr1; */
NULL, /* SDLCdata elstr2; */
{ /* SDLDocInfo doc_info; */
{
NULL, /* SDLCdata language; */
NULL, /* SDLCdata char_set; */
NULL, /* SDLId first_pg; */
NULL, /* SDLCdata doc-id; */
NULL, /* SDLCdata timestamp; */
NULL, /* SDLCdata sdldtd; */
},
},
{ /* SdlMatchData */
SdlClassText, /* SdlOption clan; */
@ -9355,7 +9357,7 @@ CreateTitleChunks(
int *ret_cnt,
void ***ret_chunks)
{
int type;
long type;
int cnt;
int result = 0;
const char *myLang;

View file

@ -317,7 +317,7 @@ TermStrDraw (
pTerm->lines[y] = (wchar_t *) malloc (sizeof(wchar_t) * (length + 1));
if (pTerm->lines[y] != NULL)
{
register i;
register int i;
wcStr = pTerm->lines[y];
_DtHelpProcessLock();
@ -340,7 +340,7 @@ TermStrDraw (
(sizeof(wchar_t) * (length + 1)));
if (pTerm->lines[y] != NULL)
{
register i;
register int i;
wcStr = pTerm->lines[y];
_DtHelpProcessLock();
for (i = pTerm->wc_num[y]; i < x; i++)

View file

@ -47,6 +47,7 @@
/*
* system includes
*/
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>

View file

@ -66,6 +66,7 @@
#include "GenUtilsP.h"
#include "FontAttrI.h"
#include "Access.h"
#include "AccessI.h"
#include "AccessP.h"
#include "AccessSDLP.h"
#include "AccessSDLI.h"

View file

@ -71,6 +71,7 @@
#include <string.h>
#include <math.h>
#include <assert.h>
#include <Xm/XmPrivate.h>
#include "GifUtilsI.h"
#ifndef __STDC__

View file

@ -89,7 +89,9 @@
/*
* private includes
*/
#include "bufioI.h"
#include "Access.h"
#include "AccessI.h"
#include "StringFuncsI.h"
#include "DisplayAreaI.h"
#include "HelpDialogP.h"
@ -97,6 +99,7 @@
#include "HelpAccessI.h"
#include "HelpUtilI.h"
#include "HelposI.h"
#include "HourGlassI.h"
#include "GlobSearchI.h"
#include "FileListUtilsI.h"
#include "FileUtilsI.h"
@ -1070,8 +1073,8 @@ done:
else *ret_helpFile = NULL;
}
/* WARNING: depends on pointers and integers the same size */
#ifdef __osf__
return (NULL == ((ulong_t)hit|(ulong_t)posFile|(ulong_t)locationIdList)) ? -1 : 0;
#ifdef __LP64__
return (NULL == ((int64_t)hit|(int64_t)posFile|(int64_t)locationIdList)) ? -1 : 0;
#else
return (0 == ((int)hit|(int)posFile|(int)locationIdList)) ? -1 : 0;
#endif

View file

@ -89,6 +89,7 @@ static char rcs_id[]="$XConsortium: Graphics.c /main/23 1996/12/06 11:12:54 cde-
#include <sys/stat.h>
#include <X11/Xlib.h>
#include <X11/XWDFile.h>
#include <X11/ImUtil.h>
#ifndef STUB
#include "il.h"
#include "ilfile.h"
@ -96,9 +97,13 @@ static char rcs_id[]="$XConsortium: Graphics.c /main/23 1996/12/06 11:12:54 cde-
#include "ilerrors.h"
#endif
#include <Xm/Xm.h>
#include <Xm/XmPrivate.h>
#include <Dt/Dts.h>
#include <Dt/xpm.h>
#include "bufioI.h"
#include "Access.h"
#include "AccessI.h"
#include "GraphicsP.h"
#include "GraphicsI.h"
#include "StringFuncsI.h"
@ -454,7 +459,7 @@ static int registry_count = XtNumber(registry);
/* Registry of converters and destructors for non-default image types */
static _DtGrRegistryRec *new_registry = NULL;
static new_registry_count = 0;
static int new_registry_count = 0;
/*****************************************************************************
* Private Routines

View file

@ -65,6 +65,7 @@
#include <Xm/SeparatoG.h>
#include <Xm/CascadeB.h>
#include <Xm/CascadeBG.h>
#include <Xm/XmPrivate.h>
/* Copied from Xm/GeoUtilsI.h */
extern XmGeoMatrix _XmGeoMatrixAlloc(
@ -81,6 +82,7 @@ extern XmGeoMatrix _XmGeoMatrixAlloc(
#include "AccessI.h"
#include "ActionsI.h"
#include "DisplayAreaI.h"
#include "DisplayAreaP.h"
#include <Dt/Help.h>
#include "HelpI.h"

View file

@ -62,6 +62,7 @@
#include <Xm/SeparatoG.h>
#include <Xm/Frame.h>
#include <Xm/RepType.h>
#include <Xm/XmPrivate.h>
/* Copied from Xm/GeoUtilsI.h */
extern XmGeoMatrix _XmGeoMatrixAlloc(
@ -79,6 +80,7 @@ extern XmGeoMatrix _XmGeoMatrixAlloc(
#include <Dt/Help.h>
#include "HelpP.h"
#include "DisplayAreaI.h"
#include "DisplayAreaP.h"
#include "StringFuncsI.h"
#include "HelpQuickDP.h"
#include "HelpQuickDI.h"

View file

@ -67,6 +67,7 @@
#include "Access.h"
#include "bufioI.h"
#include "DisplayAreaI.h"
#include "DisplayAreaP.h"
#include <Dt/Help.h>
#include "HelpI.h"
@ -76,6 +77,8 @@
#include "HelpDialogP.h"
#include "HelpUtilI.h"
#include "HelposI.h"
#include "HyperTextI.h"
#include "FormatI.h"
#include "MessagesP.h"
#include "HelpQuickD.h"
#include "SetListI.h"

View file

@ -393,7 +393,7 @@ void _DtHelpDisplayFormatError(
* Purpose: This routine inits common help stuff
*
****************************************************************************/
void _DtHelpInitCommonHelpInit(
void _DtHelpCommonHelpInit(
_DtHelpCommonHelpStuff * help);
/*****************************************************************************

View file

@ -332,7 +332,7 @@ static const _DtCvSegmentI BlankTableCell =
_DtCvCONTAINER, /* type */
-1, /* link_idx */
{ /* container info */
NULL, /* id */
{ NULL }, /* id */
NULL, /* justify_char */
_DtCvDYNAMIC, /* type */
_DtCvBORDER_NONE, /* border */
@ -348,7 +348,7 @@ static const _DtCvSegmentI BlankTableCell =
0, /* rmargin */
0, /* tmargin */
0, /* bmargin */
_DtCvBORDER_NONE, /* bdr_info */
_DtCvBORDER_NONE, /* bdr_info */
NULL /* seg_list */
},
NULL, /* next_seg */

View file

@ -900,7 +900,7 @@ _DtCvSaveInfo (
int len;
int start = layout->line_start;
int count = layout->line_bytes;
int txtCnt = canvas->txt_cnt;
long txtCnt = canvas->txt_cnt;
_DtCvUnit maxAscent = 0;
_DtCvUnit maxDescent = 0;
_DtCvUnit maxRegion = 0;
@ -1984,7 +1984,7 @@ _DtCvCvtSegsToPts (
int cnt;
int start;
int length;
int lineIdx;
long lineIdx;
int linkIdx = -1;
_DtCvValue lastVisLnk = _DtCvFALSE;
_DtCvUnit minY = -1;
@ -2020,7 +2020,7 @@ _DtCvCvtSegsToPts (
/*
* what line is this segment on?
*/
lineIdx = (int) ((*segs)->segment->internal_use);
lineIdx = (long) ((*segs)->segment->internal_use);
/*
* get some information about the line

View file

@ -181,6 +181,9 @@ extern int _DtCvSetTravEntryPos (
extern void _DtCvSortTraversalList (
_DtCanvasStruct *canvas,
_DtCvValue retain);
extern int _DtCvSetSearchEntryInfo (
_DtCanvasStruct* canvas,
int line_idx);
#ifdef __cplusplus
} /* Close scope of 'extern "C"' declaration which encloses file. */

View file

@ -58,7 +58,9 @@
* private includes
*/
#include "ObsoleteP.h"
#include "bufioI.h"
#include "Access.h"
#include "AccessI.h"
#ifdef NLS16
#endif

View file

@ -64,6 +64,7 @@
* private includes
*/
#include "DisplayAreaI.h"
#include "DisplayAreaP.h"
#include "StringFuncsI.h"
#include "HelposI.h"
#include "HelpDialogI.h"
@ -71,6 +72,7 @@
#include "HelpUtilI.h"
#include "PathAreaI.h"
#include "DestroyI.h"
#include "SetListI.h"
#include "XUICreateI.h"
/*

View file

@ -62,6 +62,7 @@
#include <Xm/RowColumn.h>
#include <Xm/MwmUtil.h>
#include <Xm/Protocols.h>
#include <Xm/ToggleB.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
@ -74,7 +75,11 @@
*/
#include "DisplayAreaI.h"
#include "bufioI.h"
#include "Access.h"
#include "AccessI.h"
#include "MessagesP.h"
#include "FormatI.h"
#include "HelpI.h"
#include "HelposI.h"
#include "HelpUtilI.h"

View file

@ -130,6 +130,13 @@ void _DtHelpPrintJob(
Boolean printToc,
char * topicTitle);
extern void _DtHelpInitPrintStuff (
_DtHelpPrintStuff * print);
extern void _DtHelpFreePrintStuff (
_DtHelpPrintStuff * print,
int cleanUpKind);
#endif /* _PrintI_h */
/* Do not add anything after this endif. */

View file

@ -49,6 +49,7 @@
/*
* private includes
*/
#include "Access.h"
#include "DisplayAreaP.h"
#include "CallbacksI.h"
#include "ResizeI.h"

View file

@ -58,6 +58,7 @@
#include "CvStringI.h"
#include "LayoutUtilI.h"
#include "SelectionI.h"
#include "VirtFuncsI.h"
#ifdef NLS16
#endif
@ -1112,7 +1113,7 @@ _DtCvDrawAreaWithFlags (
* I.E. is this line before the start or after the end?
*/
if (canvas->txt_lst[i].max_x < start.x ||
end.y == start.y && end.x <= dstX )
(end.y == start.y && end.x <= dstX) )
continue;
/*

View file

@ -67,6 +67,7 @@
#include "DisplayAreaP.h"
#include "CallbacksI.h"
#include "FontAttrI.h"
#include "FormatI.h"
#include "SetListI.h"
#include "XInterfaceI.h"
#include "XUICreateI.h"

View file

@ -68,6 +68,10 @@ extern Boolean _DtHelpSetScrollBars (
XtPointer client_data,
Dimension new_width,
Dimension new_height );
extern int _DtHelpUpdatePath (
DtHelpDispAreaStruct *pDAS,
_DtHelpVolumeHdl volume_handle,
char *loc_id);
#ifdef __cplusplus
}

View file

@ -51,7 +51,7 @@
#include <errno.h>
#include <locale.h> /* getlocale(), LOCALE_STATUS, LC_xxx */
#if defined(_AIX) || defined(USL) || defined(__uxp__)
#if defined(_AIX) || defined(USL) || defined(__uxp__) || defined(CSRG_BASED)
#include <ctype.h>
#endif
@ -493,7 +493,7 @@ int _DtHelpCeStrHashToKey(
if (!str) return 0; /* RETURN */
for (tstr = str; c = *tstr++; )
for (tstr = str; (c = *tstr++); )
key = (key << 1) + c;
return key;

View file

@ -731,9 +731,9 @@ MyDrawString (
Display *dpy,
Drawable d,
GC gc,
int font_index,
int x,
int y,
long font_index,
long x,
long y,
const void *string,
int length,
int wc,
@ -802,7 +802,7 @@ ResolveFont (
char *lang,
const char *charset,
_DtHelpFontHints font_attr,
int *ret_idx )
long *ret_idx )
{
int result = -1;
char *xlfdSpec = font_attr.xlfd;
@ -1246,8 +1246,8 @@ DADrawString (
if (strWidth)
{
MyDrawString (dpy, win, drawGC,
(int) font_ptr,
(int) x, (int) y, string, byte_len,
(long) font_ptr,
(long) x, (long) y, string, byte_len,
wc, False, pDAS->font_info);
if (pDAS->dtinfo && NULL != pSCD) {
@ -1365,7 +1365,7 @@ DADrawSpc (
_DtCvFlags new_flags )
{
int i;
int spcLstIdx = (int) spc_handle;
long spcLstIdx = (long) spc_handle;
_DtCvUnit ascent;
_DtCvUnit descent;
const char *spcStr;
@ -1693,7 +1693,7 @@ DABuildSelectedSpc (
_DtCvUnit space,
_DtCvFlags flags )
{
int spcIdx = (int) spc_handle;
long spcIdx = (long) spc_handle;
int i;
int totalLen;
int spaceNum = 0;
@ -1792,7 +1792,7 @@ _DtHelpDAResolveFont (
* note - if the mod_string comes in with a NULL pointer,
* it came from our own call rather than the Core Engine.
*/
int idx;
long idx;
(void) ResolveFont(client_data, lang, charset, font_attr, &idx);
*ret_font = (_DtCvPointer) idx;
@ -1822,8 +1822,8 @@ _DtHelpDAResolveSpc (
{
register int i = 0;
int result = -1;
int fontIdx;
int spcTbIdx = 0;
long fontIdx;
long spcTbIdx = 0;
_DtCvUnit ascent;
_DtCvUnit descent;
const char *newSet;
@ -1842,7 +1842,7 @@ _DtHelpDAResolveSpc (
if (result == 0)
{
int spcLstIdx = 0;
long spcLstIdx = 0;
_DtCvUnit maxWidth;
_DtHelpDARegion *pReg;
@ -2154,7 +2154,7 @@ _DtHelpDADestroySpc (
_DtCvPointer client_data,
_DtCvPointer spc_handle)
{
int spc_index = (int) spc_handle;
long spc_index = (long) spc_handle;
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
if (pDAS->max_spc == 0)
@ -2324,7 +2324,7 @@ _DtHelpDAGetFontMetrics (
{
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
__DtHelpFontMetrics (pDAS->font_info, (int) font_ptr,
__DtHelpFontMetrics (pDAS->font_info, (long) font_ptr,
ret_ascent, ret_descent, ret_width, ret_super, ret_sub);
}
@ -2346,7 +2346,7 @@ _DtHelpDAGetStrWidth (
{
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
int length;
int font_index;
long font_index;
_DtCvStringInfo *strInfo;
if (elem_type != _DtCvSTRING_TYPE)
@ -2362,7 +2362,7 @@ _DtHelpDAGetStrWidth (
* was opened for this string. Use the X11R5 I18N routine to figure
* out its length. Otherwise use the standard X11 text width call.
*/
font_index = (int) strInfo->font_ptr;
font_index = (long) strInfo->font_ptr;
if (font_index < 0)
{
if (0 == strInfo->wc)

View file

@ -131,6 +131,9 @@ extern void _DtHelpDARenderElem (
_DtCvElemType trav_type,
_DtCvPointer trav_data,
_DtCvPointer data);
extern void _DtHelpDATocMarker (
XtPointer client_data,
Boolean draw);
#ifdef __cplusplus
} /* Close scope of 'extern "C"' declaration which encloses file. */

View file

@ -55,6 +55,7 @@
#include <Xm/DrawnB.h>
#include <Xm/Form.h>
#include <Xm/ScrollBar.h>
#include <Xm/XmPrivate.h>
/*
* Canvas Engine
@ -66,6 +67,7 @@
* private includes
*/
#include "bufioI.h"
#include "Access.h"
#include "DisplayAreaP.h"
#include "CallbacksI.h"
#include "XUICreateI.h"

View file

@ -74,6 +74,7 @@ from the X Consortium.
* without the other).
*/
#include <X11/IntrinsicP.h>
#include <X11/Xlibint.h>
#include <X11/Xos.h>
#include <X11/Xutil.h>
@ -123,7 +124,7 @@ static void initHexTable()
/*
* read next hex value in the input stream, return -1 if EOF
*/
static NextInt (fstream)
static int NextInt (fstream)
_DtGrStream *fstream;
{
int ch;

View file

@ -100,7 +100,7 @@ BufFileRawSkip (
return count;
}
static
static int
BufFileRawFlush (
int c,
BufFilePtr f )

View file

@ -31,6 +31,7 @@
*/
/* #include "fontmisc.h" */
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>

View file

@ -46,6 +46,7 @@
#include "ilpipelem.h"
#include "ilerrors.h"
#include <Xm/XmPrivate.h>
#define X_COLOR_MAX 65535 /* max value for X colormap RGB
value */
@ -318,10 +319,11 @@ double spreadFactor;
/* Use the grays if the same number, else deallocate them.
*/
context->error = IL_OK; /* assume no errors */
if (pXWC->pGrays)
if (pXWC->pGrays) {
if (pXWC->nGrays == nGrays)
return TRUE;
else ilFreeColorData (pXWC, IL_FREE_XGRAYS);
}
if (nGrays > 256)
return FALSE; /* EXIT */

View file

@ -38,6 +38,7 @@
***-------------------------------------------------------------------*/
#include "ilint.h"
#include "ilpipeint.h"
#include "ilpipelem.h"
#include "ilconvert.h"
#include "ilerrors.h"

View file

@ -50,11 +50,11 @@ const ilImageDes ilBitonal0WhiteImageDes = { /* IL_DES_BITONAL */
/* blackIsZero */ FALSE,
/* nSamplesPerPixel */ 1,
/* noLongerUsed */ 0x10001,
/* compInfo.g3 */ {0},
/* compInfo.g3 */ { {0} },
/* reserved */ {0, 0, 0, 0},
/* flags */ 0,
/* typeInfo.YCbCr */ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* nLevelsPerSample */ 2
/* typeInfo.YCbCr */ { { { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }, 0, 0, 0, 0 } },
/* nLevelsPerSample */ { 2 }
};
const ilImageDes ilGray256ImageDes = { /* IL_DES_GRAY */
@ -63,11 +63,11 @@ const ilImageDes ilGray256ImageDes = { /* IL_DES_GRAY */
/* blackIsZero */ TRUE,
/* nSamplesPerPixel */ 1,
/* noLongerUsed */ 0x10001,
/* compInfo.g3 */ {0},
/* compInfo.g3 */ { {0} },
/* reserved */ {0, 0, 0, 0},
/* flags */ 0,
/* typeInfo.YCbCr */ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* nLevelsPerSample */ 256
/* typeInfo.YCbCr */ { { { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }, 0, 0, 0, 0 } },
/* nLevelsPerSample */ { 256 }
};
const ilImageDes ilRGB256ImageDes = { /* IL_DES_RGB */
@ -76,11 +76,11 @@ const ilImageDes ilRGB256ImageDes = { /* IL_DES_RGB */
/* blackIsZero */ FALSE,
/* nSamplesPerPixel */ 3,
/* noLongerUsed */ 0x10001,
/* compInfo.g3 */ {0},
/* compInfo.g3 */ { {0} },
/* reserved */ {0, 0, 0, 0},
/* flags */ 0,
/* typeInfo.YCbCr */ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* nLevelsPerSample */ 256, 256, 256
/* typeInfo.YCbCr */ { { { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }, 0, 0, 0, 0 } },
/* nLevelsPerSample */ { 256, 256, 256 }
};
const ilImageDes ilYCbCrImageDes = { /* IL_DES_YCBCR */
@ -89,12 +89,12 @@ const ilImageDes ilYCbCrImageDes = { /* IL_DES_YCBCR */
/* blackIsZero */ FALSE,
/* nSamplesPerPixel */ 3,
/* noLongerUsed */ 0x10001,
/* compInfo.g3 */ {0},
/* compInfo.g3 */ { {0} },
/* reserved */ {0, 0, 0, 0},
/* flags */ 0,
/* typeInfo.YCbCr */ {0, 255, 1, 1, 128, 255, 1, 1, 128, 255, 1, 1,
2990, 5870, 1140, 0},
/* nLevelsPerSample */ 256, 256, 256
/* typeInfo.YCbCr */ { { { { 0, 255, 1, 1 }, { 128, 255, 1, 1 }, { 128, 255, 1, 1 } },
2990, 5870, 1140, 0} },
/* nLevelsPerSample */ { 256, 256, 256 }
};
const ilImageDes ilYCbCr2ImageDes = { /* IL_DES_YCBCR_2 */
@ -103,12 +103,12 @@ const ilImageDes ilYCbCr2ImageDes = { /* IL_DES_YCBCR_2 */
/* blackIsZero */ FALSE,
/* nSamplesPerPixel */ 3,
/* noLongerUsed */ 0x10001,
/* compInfo.g3 */ {0},
/* compInfo.g3 */ { {0} },
/* reserved */ {0, 0, 0, 0},
/* flags */ 0,
/* typeInfo.YCbCr */ {0, 255, 1, 1, 128, 255, 2, 2, 128, 255, 2, 2,
2990, 5870, 1140, 0},
/* nLevelsPerSample */ 256, 256, 256
/* typeInfo.YCbCr */ { { { { 0, 255, 1, 1 }, { 128, 255, 2, 2 }, { 128, 255, 2, 2 } },
2990, 5870, 1140, 0} },
/* nLevelsPerSample */ { 256, 256, 256 }
};
const ilImageDes ilPaletteImageDes = { /* IL_DES_PALETTE */
@ -117,11 +117,11 @@ const ilImageDes ilPaletteImageDes = { /* IL_DES_PALETTE */
/* blackIsZero */ FALSE,
/* nSamplesPerPixel */ 1,
/* noLongerUsed */ 0x10001,
/* compInfo.g3 */ {0},
/* compInfo.g3 */ { {0} },
/* reserved */ {0, 0, 0, 0},
/* flags */ 0,
/* typeInfo.YCbCr */ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* nLevelsPerSample */ 256
/* typeInfo.YCbCr */ { { { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }, 0, 0, 0, 0 } },
/* nLevelsPerSample */ { 256 }
};
@ -147,16 +147,16 @@ const unsigned char ilBitReverseTable [256] =
const ilImageFormat ilBitImageFormat = /* IL_FORMAT_BIT */
{ IL_SAMPLE_PIXELS, IL_MSB_FIRST, 32, 0, 0, 0, 0, 1 };
{ IL_SAMPLE_PIXELS, IL_MSB_FIRST, 32, { 0, 0, 0, 0 }, { 1 } };
const ilImageFormat ilByteImageFormat = /* IL_FORMAT_BYTE */
{ IL_SAMPLE_PIXELS, IL_MSB_FIRST, 8, 0, 0, 0, 0, 8 };
{ IL_SAMPLE_PIXELS, IL_MSB_FIRST, 8, { 0, 0, 0, 0 }, { 8 } };
const ilImageFormat il3BytePixelImageFormat = /* IL_FORMAT_3BYTE_PIXEL */
{ IL_SAMPLE_PIXELS, IL_MSB_FIRST, 8, 0, 0, 0, 0, 8, 8, 8 };
{ IL_SAMPLE_PIXELS, IL_MSB_FIRST, 8, { 0, 0, 0, 0 }, { 8, 8, 8 } };
const ilImageFormat il3BytePlaneImageFormat = /* IL_FORMAT_3BYTE_PLANEL */
{ IL_SAMPLE_PLANES, IL_MSB_FIRST, 8, 0, 0, 0, 0, 8, 8, 8 };
{ IL_SAMPLE_PLANES, IL_MSB_FIRST, 8, { 0, 0, 0, 0 }, { 8, 8, 8 } };
/* Table of shift values, indexed by YCbCr subsample values (1, 2 or 4) */

View file

@ -75,4 +75,10 @@ IL_EXTERN ilBool _ilDecompPackbits (
ilImageFormat *pimformat
);
IL_EXTERN ilBool _ilDecompJPEG (
ilPipe pipe,
ilPipeInfo *pInfo,
ilImageDes *pDes
);
#endif

View file

@ -389,12 +389,12 @@ unsigned long *pNLines
if ( tag_bit ) {
pPriv->srcpos++;
if (error = _ilDecompG3Line(pPriv,dstImageP) )
if ((error = _ilDecompG3Line(pPriv,dstImageP)) )
return error;
}
else {
pPriv->srcpos++;
if (error = _ilDecompG4Line(pPriv,pRefLine,dstImageP) )
if ((error = _ilDecompG4Line(pPriv,pRefLine,dstImageP)) )
return error;
}
@ -402,7 +402,7 @@ unsigned long *pNLines
if ( ( !Is_EOLs) && ( ( temp = pPriv->srcpos % 8) != 0 ) )
pPriv->srcpos += (8-temp) ;
if (error = _ilDecompG3Line(pPriv,dstImageP) )
if ((error = _ilDecompG3Line(pPriv,dstImageP)) )
return error;
} /* is 2d coding */

View file

@ -564,7 +564,7 @@ unsigned long *pNLines
while ( nLines-- > 0 )
{
if (error = _ilDecompG4Line(pPriv,pRefLine,dstImageP) )
if ((error = _ilDecompG4Line(pPriv,pRefLine,dstImageP)) )
return error;
pRefLine = dstImageP;

View file

@ -179,3 +179,8 @@ IL_EXTERN const ilDecompG4HuffTableRec ilArFax1DDecodeBlack[G4K_BlackTableSize];
IL_EXTERN const ilDecompG4HuffTableRec ilArFax2DDecodeTable[G4K_DecodeTableSize];
IL_EXTERN ilError _ilDecompG4Line(
register ilDecompG3G4PrivPtr pPriv,
ilPtr pRefLine,
ilPtr dstImageP
);

View file

@ -86,7 +86,7 @@ static ilError ilDecompCleanup (
/* Cleanup from JPEG decode, but only if firstStrip setup done */
if (!pPriv->firstStrip) {
if (pPriv->pJPEGPriv)
if (error = iljpgDecodeCleanup (pPriv->pJPEGPriv))
if ((error = iljpgDecodeCleanup (pPriv->pJPEGPriv)))
return error;
if (pPriv->pJPEGData)
return iljpgFreeData (pPriv->pJPEGData);
@ -120,7 +120,7 @@ static ilError ilDecompRawExecute (
/* If first strip, setup iljpg data and call iljpg Init() function */
if (pPriv->firstStrip) {
_ilJPEGTablesIn ((ilJPEGData *)pSrcImage->pCompData, &pPriv->jpgData);
if (error = iljpgDecodeInit (&pPriv->jpgData, &pPriv->pJPEGPriv))
if ((error = iljpgDecodeInit (&pPriv->jpgData, &pPriv->pJPEGPriv)))
return error;
pPriv->firstStrip = FALSE;
}
@ -167,9 +167,9 @@ static ilError ilDecompJIFExecute (
if (firstStrip) {
pPriv->streamRec.pData = pData->pSrcImage->plane[0].pPixels;
pPriv->streamRec.nBytesLeft = pData->compressed.nBytesToRead;
if (error = iljpgDecodeJIF (&pPriv->streamRec, &pPriv->pJPEGData))
if ((error = iljpgDecodeJIF (&pPriv->streamRec, &pPriv->pJPEGData)))
return error;
if (error = iljpgDecodeInit (pPriv->pJPEGData, &pPriv->pJPEGPriv))
if ((error = iljpgDecodeInit (pPriv->pJPEGData, &pPriv->pJPEGPriv)))
return error;
}
@ -184,8 +184,8 @@ static ilError ilDecompJIFExecute (
if ((pPriv->nLinesWritten + pPriv->stripHeight) > pPriv->jpgData.height)
*pNLines = pPriv->jpgData.height - pPriv->nLinesWritten;
else *pNLines = pPriv->stripHeight;
if (error = iljpgDecodeExecute (pPriv->pJPEGPriv, &pPriv->streamRec, FALSE, *pNLines,
pPixels, nBytesPerRow))
if ((error = iljpgDecodeExecute (pPriv->pJPEGPriv, &pPriv->streamRec, FALSE, *pNLines,
pPixels, nBytesPerRow)))
return error;
/* Handle based on whether firstStrip and/or last strip:
@ -212,7 +212,7 @@ static ilError ilDecompJIFExecute (
/* Called by ilDecompress() when pipe image is JPEG compressed. Add a filter to
decompress the pipe image.
*/
IL_PRIVATE ilBool _ilDecompJPEG (
ilBool _ilDecompJPEG (
ilPipe pipe,
ilPipeInfo *pInfo,
ilImageDes *pDes

View file

@ -1027,7 +1027,7 @@ IL_PRIVATE ilBool _ilConvertRGBToPalette (
int i, shifts[3], nColors;
const unsigned short *pMulTable[3]; /* dither other than 484 only: pMul? */
static ilConvertToPaletteInfo defaultConvert =
{IL_DIFFUSION, 4, 8, 4, 8, IL_PALETTE, (ilObject)NULL};
{IL_DIFFUSION, { 4, 8, 4 }, 8, IL_PALETTE, (ilObject)NULL};
/* Init to null those things freed by "cleanup" if error. */

View file

@ -292,10 +292,11 @@ register int rowBitAlign, nBits, nSamplesPerPixel, i;
while (nSamplesPerPixel-- > 0) {
nBits = *pNBits++;
if (nBits > 8)
if (nBits > 8) {
if (nBits <= 16)
nBits = 16;
else nBits = 32;
}
if (pYCbCr) {
i = width >> _ilSubsampleShift[pYCbCr->subsampleHoriz];
if (i <= 0) i = 1;
@ -373,9 +374,9 @@ register ilYCbCrSampleInfo *pYCbCr;
else {
pPixels = (ilPtr)IL_MALLOC (nBytesToAlloc);
if (!pPixels) { /* error; free those already created */
while (plane != 0) {
while ((plane != 0)) {
plane--;
if (pPixels = pImage->i.plane[plane].pPixels)
if ((pPixels = pImage->i.plane[plane].pPixels))
IL_FREE (pPixels);
}
pImage->i.clientPixels = TRUE; /* so IL does not deallocate them */
@ -500,7 +501,7 @@ ilError error;
}
/* Validate pDes: don't allow user-defined types. */
if (context->error = _ilValidateDesFormat (FALSE, pDes, (ilImageFormat *)NULL))
if ((context->error = _ilValidateDesFormat (FALSE, pDes, (ilImageFormat *)NULL)))
return (ilInternalImage)NULL;
/* Create the object and add it to context. */
@ -564,7 +565,7 @@ ilError error;
pImage->i.pPalette = (unsigned short *)NULL;
pImage->i.clientPalette = TRUE;
if (error = _ilMallocImagePixels (pImage)) {
if ((error = _ilMallocImagePixels (pImage))) {
ilDestroyObject ((ilObject)pImage);
context->error = error;
return (ilInternalImage)NULL;
@ -665,7 +666,7 @@ int plane, nPlanes;
}
/* Validate pDes and pFormat: do allow user-defined types. */
if (context->error = _ilValidateDesFormat (TRUE, pInfo->pDes, pInfo->pFormat))
if ((context->error = _ilValidateDesFormat (TRUE, pInfo->pDes, pInfo->pFormat)))
return (ilClientImage)NULL;
/* Create the object and add it to context. */
@ -733,7 +734,7 @@ int plane, nPlanes;
pImage->i.plane[plane] = pInfo->plane[plane];
}
else { /* no pixels from client; allocate them here if uncompressed image */
if (error = _ilMallocImagePixels (pImage)) {
if ((error = _ilMallocImagePixels (pImage))) {
ilDestroyObject ((ilObject)pImage);
context->error = error;
return (ilClientImage)NULL;

View file

@ -186,7 +186,7 @@ iljpgError iljpgDecodeExecute (
/* Reset Huffman decoding: beginning of a strip/restart interval */
if (doReset) {
if (error = _iljpgDehuffReset (pPriv))
if ((error = _iljpgDehuffReset (pPriv)))
return error;
}
@ -201,7 +201,7 @@ iljpgError iljpgDecodeExecute (
If a restart interval and mcu count >, do a reset/restart.
*/
if (restartInterval && (pPriv->mcuRestartCount >= restartInterval)) {
if (error = _iljpgDehuffReset (pPriv))
if ((error = _iljpgDehuffReset (pPriv)))
return error;
pPriv->mcuRestartCount = 0;
}
@ -212,8 +212,8 @@ iljpgError iljpgDecodeExecute (
for (v = 0, bY = pComp->y; v < pComp->vertFactor; v++, bY += 8) {
for (h = 0, bX = pComp->x; h < pComp->horiFactor; h++, bX += 8) {
if (error = _iljpgDehuffExecute (pPriv, stream, comp, outHuff,
&blockType))
if ((error = _iljpgDehuffExecute (pPriv, stream, comp, outHuff,
&blockType)))
return error;
/* Add previous DC to this one, save away for next */

View file

@ -172,9 +172,9 @@ iljpgError iljpgDecodeJIF (
/* DRI: get value and save into restartInterval */
case ILJPGM_DRI:
if (error = iljpgGet2Bytes (stream, &value)) /* length */
if ((error = iljpgGet2Bytes (stream, &value))) /* length */
goto JIFError;
if (error = iljpgGet2Bytes (stream, &value)) /* restart interval */
if ((error = iljpgGet2Bytes (stream, &value))) /* restart interval */
goto JIFError;
pData->restartInterval = value;
break;
@ -182,15 +182,15 @@ iljpgError iljpgDecodeJIF (
/* Start Of Frame 0 (SOF0): save Q table indices; note marker seen. */
case ILJPGM_SOF0:
SOF0Found = TRUE;
if (error = iljpgGet2Bytes (stream, &value)) /* length */
if ((error = iljpgGet2Bytes (stream, &value))) /* length */
goto JIFError;
if (!ILJPG_DECODE_GET_BYTE (stream, value, error))
goto JIFError;
if (value != 8) /* precision != 8; not supported */
goto BadJIFData;
if (error = iljpgGet2Bytes (stream, &pData->height))
if ((error = iljpgGet2Bytes (stream, &pData->height)))
goto JIFError;
if (error = iljpgGet2Bytes (stream, &pData->width))
if ((error = iljpgGet2Bytes (stream, &pData->width)))
goto JIFError;
if (!ILJPG_DECODE_GET_BYTE (stream, nFrameComps, error))
goto JIFError;
@ -218,7 +218,7 @@ iljpgError iljpgDecodeJIF (
Multiple tables ("n") can be defined: n = (length-2)/65;
*/
case ILJPGM_DQT:
if (error = iljpgGet2Bytes (stream, &length)) /* length */
if ((error = iljpgGet2Bytes (stream, &length))) /* length */
goto JIFError;
length -= 2; /* includes itself */
while (length > 0) {
@ -254,7 +254,7 @@ iljpgError iljpgDecodeJIF (
4 AC or DC tables are allowed,used by "extended" DCT mode.
*/
case ILJPGM_DHT:
if (error = iljpgGet2Bytes (stream, &length))
if ((error = iljpgGet2Bytes (stream, &length)))
goto JIFError;
length -= 2; /* length includes itself */
while (length > 0) {
@ -307,7 +307,7 @@ iljpgError iljpgDecodeJIF (
SOSFound = TRUE; /* terminate while loop */
if (!SOF0Found) /* SOS before SOF0 is an error */
goto BadJIFData;
if (error = iljpgGet2Bytes (stream, &value)) /* length */
if ((error = iljpgGet2Bytes (stream, &value))) /* length */
goto JIFError;
if (!ILJPG_DECODE_GET_BYTE (stream, value, error)) /* Ns (0..3) */
@ -357,15 +357,15 @@ iljpgError iljpgDecodeJIF (
goto BadJIFData;
} /* END each scan header component */
if (error = iljpgSkipBytes (stream, 3)) /* skip Ss, Se, Ah/Al */
if ((error = iljpgSkipBytes (stream, 3))) /* skip Ss, Se, Ah/Al */
goto JIFError;
break;
/* All other markers have lengths: get length and skip length-2 bytes */
default:
if (error = iljpgGet2Bytes (stream, &value))
if ((error = iljpgGet2Bytes (stream, &value)))
goto JIFError;
if (error = iljpgSkipBytes (stream, value - 2)) /* "length" already skipped */
if ((error = iljpgSkipBytes (stream, value - 2))) /* "length" already skipped */
goto JIFError;
break;
} /* END switch marker */

View file

@ -57,7 +57,7 @@ _gotoLabel: \
/* compute 2-D DCT descaling matrix */
static _il_fwft_rev_scale (
static void _il_fwft_rev_scale (
iljpgPtr q, /* pointer to quantization matrix */
float *s /* pointer to pointer to descaling matrix */
)

View file

@ -394,14 +394,14 @@ iljpgError _iljpgDehuffInit (
/* Build lookup tables from DC/AC tables from caller (*pPriv->pData) */
for (i = 0; i < 4; i++) {
if (pTable = pData->DCTables[i]) {
if (error = build_huffman_tables (pTable, (pTable+16), LOOKUP_BITS,
&pHuffPriv->table_set_dc[i]))
if ((pTable = pData->DCTables[i])) {
if ((error = build_huffman_tables (pTable, (pTable+16), LOOKUP_BITS,
&pHuffPriv->table_set_dc[i])))
return error;
}
if (pTable = pData->ACTables[i]) {
if (error = build_huffman_tables (pTable, (pTable+16), LOOKUP_BITS,
&pHuffPriv->table_set_ac[i]))
if ((pTable = pData->ACTables[i])) {
if ((error = build_huffman_tables (pTable, (pTable+16), LOOKUP_BITS,
&pHuffPriv->table_set_ac[i])))
return error;
}
}

View file

@ -44,6 +44,7 @@
#include <stdlib.h>
#include "ilcodec.h"
#include "ilint.h"
#include "ilimage.h"
#include "ilpipelem.h"
@ -1102,7 +1103,7 @@ ilBool constantStrip, haveConsumerImage, insertCopyFilter;
pPipe->image.info.constantStrip = pDstData->constantStrip;
pPipe->image.info.stripHeight = pDstData->stripHeight;
}
if (pDes = pDstData->pDes) {
if ((pDes = pDstData->pDes)) {
if (pDes->type == IL_PALETTE) {
if (pDstData->pPalette)
pPipe->image.info.pPalette = pDstData->pPalette;

View file

@ -41,6 +41,7 @@
#include "ilpipelem.h"
#include "ilscaleint.h"
#include "ilerrors.h"
#include "ilconvert.h"
#define LONGSZ 4
#ifdef LSB_BIT_ORDER

View file

@ -216,8 +216,8 @@ register ilBool bigEndian;
else pFileTag++;
}
if (tagFound) {
mallocSize += sizeof (ilFileTag) +
(pFileTag->length * _ilTagTypeItemSizes [pFileTag->type] + 3) & ~3;
mallocSize += (sizeof (ilFileTag) +
(pFileTag->length * _ilTagTypeItemSizes [pFileTag->type] + 3)) & ~3;
*ppTag++ = (ilFileTag *)pFileTag;
}
else *ppTag++ = (ilFileTag *)NULL;
@ -384,7 +384,7 @@ static void ilAddImageToList (
/* Main image: if page # present, add to list in page order, else add to end */
case mainImage:
if (pFileImage->p.nPages < 0) { /* no page #; add to end of list */
if (pFileImage->p.pPrev = (ilFileImage)pFile->pFileImageTail)
if ((pFileImage->p.pPrev = (ilFileImage)pFile->pFileImageTail))
pFileImage->p.pPrev->pNext = (ilFileImage)pFileImage;
else pFile->pFileImageHead = pFileImage;
}
@ -1061,7 +1061,7 @@ register ilBool bigEndian;
/* Add file image to list, if supported. An error is returned only if
the file image is malformed; not if it is just unsupported.
*/
if (error = ilReadTagsAndAddImageToList (pFile, &pPrevFileImage, pFileImage))
if ((error = ilReadTagsAndAddImageToList (pFile, &pPrevFileImage, pFileImage)))
goto LFIFatalError; /* fatal error returned; EXIT */
/* Read and flip offset to next IFD, at end of tags; save in pFile. */

View file

@ -298,9 +298,9 @@ int stripOffsetsIndex, stripByteCountsIndex, colorMapIndex,
|| (pACTag->nItems != nSamples) || (pACTag->type != IL_TAG_LONG))
return IL_ERROR_FILE_MALFORMED_TAG;
if (error = ilReadJPEGTags (pPriv->pFile, nSamples, (long *)pQTag->pItems,
if ((error = ilReadJPEGTags (pPriv->pFile, nSamples, (long *)pQTag->pItems,
(long *)pDCTag->pItems, (long *)pACTag->pItems,
(ilJPEGData *)pPriv->pCompData))
(ilJPEGData *)pPriv->pCompData)))
return error;
/* If restartInterval tag present, store value else default to 0 */
@ -332,7 +332,7 @@ int stripOffsetsIndex, stripByteCountsIndex, colorMapIndex,
hasCountBug = FALSE;
hasOffsetBug = FALSE;
if (pSoftwareTag = tags[softwareIndex]) {
if ((pSoftwareTag = tags[softwareIndex])) {
pName = (char *)pSoftwareTag->pItems;
if ((pSoftwareTag->nItems >= 7) && (pName[0] == 'H') && (pName[1] == 'P')
&& (pName[2] == ' ') && (pName[3] == 'I') && (pName[4] == 'L')