}
if (useV34 || gotRTNC) { // V.34 mode or if +FRH:3 in adaptive reception
if (!gotEOT) {
- bool gotprimary;
+ bool gotprimary = false;
if (useV34) gotprimary = waitForDCEChannel(false);
while (!sendERR && !gotEOT && (gotRTNC || (ctrlFrameRcvd != fxStr::null))) {
/*
bool
Class2Modem::parseFPTS(TIFF* tif, const char* cp, int& ppr)
{
- uint32 lc = 0;
+ u_long lc = 0;
int blc = 0;
int cblc = 0;
ppr = 0;
- if (sscanf(cp, "%d,%d,%d,%d", &ppr, &lc, &blc, &cblc) > 0) {
+ if (sscanf(cp, "%d,%ld,%d,%d", &ppr, &lc, &blc, &cblc) > 0) {
/*
* In practice we cannot trust the modem line count when we're
* is done instead of replacing the missing data with white
* to avoid visual disconnect of blackened areas.
*/
- if (decodedPixels < rowpixels) {
+ if ((u_int) decodedPixels < rowpixels) {
u_int filledchars = (decodedPixels + 7) / 8;
u_short rembits = decodedPixels % 8;
memcpy(recvRow + filledchars, curGood + filledchars, rowSize - filledchars);
// now deal with the transitional character
u_char remmask = 0;
for (u_short bit = 0; bit < 8; bit++) {
- remmask<<1;
+ remmask<<=1;
if (bit < rembits) remmask |= 1;
}
recvRow[filledchars-1] = (recvRow[filledchars-1] & remmask) | (curGood[filledchars-1] & ~remmask);
}
- } else if (decodedPixels >= rowpixels) {
+ } else if ((u_int) decodedPixels >= rowpixels) {
/*
* If we get a long pixel count, then our correction mechanism
* involves trimming horizontal "streaks" at the end of the
Sys::close(fd);
return;
}
- ftruncate(fd, cc);
+ (void) ftruncate(fd, cc);
Sys::close(fd);
} else
error("open: %m");
}
lseek(fd, 0L, SEEK_SET);
Sys::write(fd, sb, sb.getLength());
- ftruncate(fd, sb.getLength());
+ (void) ftruncate(fd, sb.getLength());
// XXX maybe should fsync, but not especially portable
}
bp++;
} else
span = 0;
- if (bits >= 2*8*sizeof (long)) {
+ if ((uint32) bits >= 2*8*sizeof (long)) {
long* lp;
/*
* Align to longword boundary and check longwords.
bp++;
}
lp = (long*) bp;
- while (bits >= 8*sizeof (long) && *lp == 0) {
+ while ((uint32) bits >= 8*sizeof (long) && *lp == 0) {
span += 8*sizeof (long), bits -= 8*sizeof (long);
lp++;
}
bp++;
} else
span = 0;
- if (bits >= 2*8*sizeof (long)) {
+ if ((uint32) bits >= 2*8*sizeof (long)) {
long* lp;
/*
* Align to longword boundary and check longwords.
bp++;
}
lp = (long*) bp;
- while (bits >= 8*sizeof (long) && *lp == ~0) {
+ while ((uint32) bits >= 8*sizeof (long) && *lp == ~0) {
span += 8*sizeof (long), bits -= 8*sizeof (long);
lp++;
}
span = findspan(&bp, bs, w, zeroruns); // white span
putspan(span, TIFFFaxWhiteCodes);
bs += span;
- if (bs >= w)
+ if ((u_int) bs >= w)
break;
span = findspan(&bp, bs, w, oneruns); // black span
putspan(span, TIFFFaxBlackCodes);
bs += span;
- if (bs >= w)
+ if ((u_int) bs >= w)
break;
}
}
static const u_int mask[9] =
{ 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
- while (length > bit) {
+ while (length > (u_short) bit) {
data |= bits >> (length - bit);
length -= bit;
flushBits();
struct stat sb;
Sys::fstat(fd, sb);
#if HAS_FCHOWN
- fchown(fd, 0, sb.st_gid);
+ (void) fchown(fd, 0, sb.st_gid);
#else
Sys::chown(getLine(), 0, sb.st_gid);
#endif
// XXX can't sort
int JobControlInfo::compare(const JobControlInfo*) const { return (0); }
-static int getNumber(const char* s) { return ((int) strtol(s, NULL, 0)); }
-
void
JobControlInfo::configError (const char* fmt, ...)
{
*/
u_char* MemoryDecoder::cutExtraRTC()
{
- u_char* start = current();
-
/*
* We expect RTC near the end of data and thus
* do not check all image to save processing time.
G3Encoder enc(result);
enc.setupEncoder(fillorder, is2D, isG4);
- u_char* start = current();
decode(NULL, width, th); // discard decoded data
if (!isG4) {
/*
printf("Attempt to convert Phase C data to JBIG without JBIG support. This should not happen.\n");
return (NULL);
#endif /* HAVE_JBIG */
+ } else {
+ printf("Attempt to convert Phase C data to an unsupported format. This should not happen.\n");
+ return (NULL);
}
}
case MODEMWAIT:
setupAttempts = 0;
break;
+ default:
+ break;
}
} else if (s == MODEMWAIT && ++setupAttempts >= maxSetupAttempts) {
traceStatus(FAXTRACE_SERVER,
va_end(ap);
fprintf(statusFile, "\n");
fflush(statusFile);
- ftruncate(fileno(statusFile), ftell(statusFile));
+ (void) ftruncate(fileno(statusFile), ftell(statusFile));
flock(fileno(statusFile), LOCK_UN);
}
*/
u_int w = params.pageWidth();
u_int h = (tagLineFont->fontHeight()*2)+MARGIN_TOP+MARGIN_BOT; // max height - double VR_FINE
- u_int th; // actual tagline height
+ u_int th = 0; // actual tagline height
switch(params.vr) {
case VR_NORMAL:
case VR_200X100:
u_int bpl = sizeof(u_long) * 8; // bits per u_long
for (u_int nl = lpr/2 - 1; nl ; nl--) {
// make 2 longs out of 1 (ABCD -> AABB CCDD)
- int pos;
+ int pos = 0;
for (u_int i = 0; i < (bpl/8); i++) {
if (i == 0 || i == bpl/8/2) {
*l2 = (u_long) 0;
Sys::chmod(buff, mode);
#endif
#if HAS_FCHOWN
- fchown(fd, UUCPuid, UUCPgid);
+ (void) fchown(fd, UUCPuid, UUCPgid);
#else
Sys::chown(buff, UUCPuid, UUCPgid);
#endif
int
main(int argc, char* argv[])
{
- extern int optind, opterr;
+ extern int optind;
extern char* optarg;
float minChop = 3.0; // chop if >= 3" white space at bottom
u_int minRows;
printf(
"Chop %u rows, strip was %lu bytes, need only %lu\n"
, dec.getLastBlanks()
- , totbytes
- , dec.getEndOfPage() - data
+ , (u_long) totbytes
+ , (u_long) (dec.getEndOfPage() - data)
);
} else {
printf("Don't chop, found %u rows, need %u rows\n"
main(int argc, char* argv[])
{
const char* outFile = "cq.tif";
- extern int optind, opterr;
+ extern int optind;
extern char* optarg;
int c;
/* DID modems may only signal a call with DID data - no RING */
bool done = false;
for (u_int i = 0; i < callid.size(); i++) {
- if (idConfig[i].answerlength > 0 && callid[i].length() >= idConfig[i].answerlength) {
+ if ((u_int) idConfig[i].answerlength > 0 &&
+ callid[i].length() >= (u_int) idConfig[i].answerlength) {
done = true;
break;
}
// suffix, when the PS.jobid version of the file still
// exists.
char *base;
- int sl=k-docDir.length()-1-1; // removing docDir,'/' and trailing ';'
+ u_int sl=k-docDir.length()-1-1; // removing docDir,'/' and trailing ';'
base=(char *)malloc(sl+1);
strncpy(base, &file[docDir.length()+1], sl);
base[sl]=0;
float threshold = req.chopthreshold;
if (threshold == -1)
threshold = pageChopThreshold;
- u_int minRows;
+ u_int minRows = 0;
switch(params.vr) {
case VR_NORMAL:
case VR_200X100:
if (req && req->status == send_retry) {
// prevent turnaround-redialing, delay any blocked jobs
time_t newtts = req->tts;
- while (cjob = di.nextBlocked()) {
+ while ((cjob = di.nextBlocked())) {
FaxRequest* blockedreq = readRequest(*cjob);
if (blockedreq) {
delayJob(*cjob, *blockedreq, "Delayed by prior call", newtts);
u_int batched = BATCH_FIRST;
FaxSendStatus status = send_done;
fxStr batchcommid, notice;
- time_t retrybatchtts;
+ time_t retrybatchtts = 0;
for (int i = 0; i < num; i++)
{
u_int batched = BATCH_FIRST;
FaxSendStatus status = send_done;
fxStr batchcommid, notice;
- time_t retrybatchtts;
+ time_t retrybatchtts = 0;
for (int i = 0; i < num; i++) {
if (i+1 == num)
u_int unknown = 0; // count of unknown responses
time_t start = Sys::now();
do {
- u_int len = getResponse(resp, ixoXmitTimeout);
+ (void) getResponse(resp, ixoXmitTimeout);
const fxStr str = (const char*)resp;
//readUcpResponse(str);
fxStr tmp;
*/
u_int w = params.pageWidth();
u_int h = (tagLineFont->fontHeight()*2)+MARGIN_TOP+MARGIN_BOT; // max height - double VR_FINE
- u_int th; // actual tagline height
+ u_int th = 0; // actual tagline height
switch(params.vr) {
case VR_NORMAL:
case VR_200X100:
u_int bpl = sizeof(u_long) * 8; // bits per u_long
for (u_int nl = lpr/2 - 1; nl ; nl--) {
// make 2 longs out of 1 (ABCD -> AABB CCDD)
- int pos;
+ int pos = 0;
for (u_int i = 0; i < (bpl/8); i++) {
if (i == 0 || i == bpl/8/2) {
*l2 = (u_long) 0;
int
main(int argc, char* argv[])
{
- extern int optind, opterr;
+ extern int optind;
extern char* optarg;
int c;
const char* output = "t.tif";
#define CLEANUP_RUNS() do { \
if (RunLength) \
SETVAL(0); \
- if (a0 != lastx) { \
- badlength(a0, lastx); \
- while (a0 > lastx && pa > thisrun) \
+ if ((tiff_runlen_t)a0 != lastx) { \
+ badlength((tiff_runlen_t)a0, lastx); \
+ while ((tiff_runlen_t)a0 > lastx && pa > thisrun) \
a0 -= *--pa; \
- if (a0 < lastx) { \
+ if ((tiff_runlen_t)a0 < lastx) { \
if (a0 < 0) \
a0 = 0; \
if ((pa-thisrun)&1) \
SETVAL(0); \
SETVAL(lastx - a0); \
- } else if (a0 > lastx) { \
+ } else if ((tiff_runlen_t)a0 > lastx) { \
SETVAL(lastx); \
SETVAL(0); \
} \
} \
} \
doneWhite1d: \
- if (a0 >= lastx) \
+ if ((tiff_runlen_t)a0 >= lastx) \
goto done1d; \
for (;;) { \
LOOKUP16(13, TIFFFaxBlackTable, eof1d); \
} \
} \
doneBlack1d: \
- if (a0 >= lastx) \
+ if ((tiff_runlen_t)a0 >= lastx) \
goto done1d; \
if( *(pa-1) == 0 && *(pa-2) == 0 ) \
pa -= 2; \
* of runs for the reference line.
*/
#define CHECK_b1 do { \
- if (pa != thisrun) while (b1 <= a0 && b1 < lastx) { \
+ if (pa != thisrun) while (b1 <= a0 && (tiff_runlen_t)b1 < lastx) { \
b1 += pb[0] + pb[1]; \
pb += 2; \
} \
* Expand a row of 2D-encoded data.
*/
#define EXPAND2D(eoflab) do { \
- while (a0 < lastx) { \
+ while ((tiff_runlen_t)a0 < lastx) { \
LOOKUP8(7, TIFFFaxMainTable, eof2d); \
switch (TabEnt->State) { \
case S_Pass: \
} \
} \
if (RunLength) { \
- if (RunLength + a0 < lastx) { \
+ if ((tiff_runlen_t)(RunLength + a0) < lastx) { \
/* expect a final V0 */ \
NeedBits8(1,eof2d); \
if (!GetBits(1)) \
main(int argc, char* argv[])
{
bool verbose = true;
- extern int optind, opterr;
- extern char* optarg;
+ extern int optind;
int c;
appName = argv[0];