libprint: fix invalid use of long.
This commit is contained in:
@@ -11,10 +11,12 @@
|
||||
#include <Message.h>
|
||||
#include <Node.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// #define DBG
|
||||
|
||||
#ifdef DBG
|
||||
void write_debug_stream(const char *, ...);
|
||||
void write_debug_stream(const char *, ...) __PRINTFLIKE(1,2);
|
||||
void DUMP_BFILE(BFile *file, const char *name);
|
||||
void DUMP_BMESSAGE(BMessage *msg);
|
||||
void DUMP_BDIRECTORY(BDirectory *dir);
|
||||
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
private:
|
||||
BFile *fFile;
|
||||
bool fReverse;
|
||||
int fPictureCount;
|
||||
int fRest;
|
||||
int32 fPictureCount;
|
||||
int32 fRest;
|
||||
off_t fOffset;
|
||||
bool fHollow;
|
||||
};
|
||||
@@ -49,7 +49,7 @@ typedef list<PageData *> PageDataList;
|
||||
|
||||
class SpoolData {
|
||||
public:
|
||||
SpoolData(BFile *file, int page_count, int nup, bool reverse);
|
||||
SpoolData(BFile *file, int32 page_count, int32 nup, bool reverse);
|
||||
~SpoolData();
|
||||
bool startEnum();
|
||||
bool enumObject(PageData **);
|
||||
|
||||
@@ -26,9 +26,9 @@ protected:
|
||||
|
||||
UIDriver& operator=(const UIDriver &);
|
||||
|
||||
virtual long PageSetup(JobData* jobData, PrinterData* printerData,
|
||||
virtual status_t PageSetup(JobData* jobData, PrinterData* printerData,
|
||||
const PrinterCap* printerCap);
|
||||
virtual long JobSetup(JobData* jobData, PrinterData* printerData,
|
||||
virtual status_t JobSetup(JobData* jobData, PrinterData* printerData,
|
||||
const PrinterCap* printerCap);
|
||||
|
||||
private:
|
||||
|
||||
@@ -53,7 +53,7 @@ void DUMP_BMESSAGE(BMessage *msg)
|
||||
int32 count = 0;
|
||||
|
||||
DBGMSG(("\t************ START - DUMP BMessage ***********\n"));
|
||||
DBGMSG(("\taddress: 0x%x\n", (int)msg));
|
||||
DBGMSG(("\taddress: %p\n", msg));
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ PageData::PageData(BFile *file, bool reverse)
|
||||
fHollow = false;
|
||||
|
||||
if (reverse) {
|
||||
file->Read(&fPictureCount, sizeof(long));
|
||||
DBGMSG(("picture_count = %d\n", (int)fPictureCount));
|
||||
file->Read(&fPictureCount, sizeof(int32));
|
||||
DBGMSG(("picture_count = %" B_PRId32 "\n", fPictureCount));
|
||||
fOffset = fFile->Position();
|
||||
off_t o = fOffset;
|
||||
// seek to start of next page
|
||||
@@ -75,8 +75,8 @@ PageData::startEnum()
|
||||
return false;
|
||||
|
||||
if (fOffset == 0) {
|
||||
fFile->Read(&fPictureCount, sizeof(long));
|
||||
DBGMSG(("picture_count = %d\n", (int)fPictureCount));
|
||||
fFile->Read(&fPictureCount, sizeof(int32));
|
||||
DBGMSG(("picture_count = %" B_PRId32 "\n", fPictureCount));
|
||||
fOffset = fFile->Position();
|
||||
} else {
|
||||
fFile->Seek(fOffset, SEEK_SET);
|
||||
@@ -104,15 +104,15 @@ PageData::enumObject(PictureData **picture_data)
|
||||
}
|
||||
|
||||
|
||||
SpoolData::SpoolData(BFile *file, int page_count, int nup, bool reverse)
|
||||
SpoolData::SpoolData(BFile *file, int32 page_count, int32 nup, bool reverse)
|
||||
{
|
||||
DBGMSG(("nup = %d\n", nup));
|
||||
DBGMSG(("page_count = %d\n", page_count));
|
||||
DBGMSG(("nup = %" B_PRId32 "\n", nup));
|
||||
DBGMSG(("page_count = %" B_PRId32 "\n", page_count));
|
||||
DBGMSG(("reverse = %s\n", reverse ? "true" : "false"));
|
||||
|
||||
if (reverse) {
|
||||
if (nup > 1) {
|
||||
for (int page_index = 0; page_index < page_count; page_index++) {
|
||||
for (int32 page_index = 0; page_index < page_count; page_index++) {
|
||||
if (page_index % nup == 0) {
|
||||
fPages.push_front(new PageData(file, reverse));
|
||||
fIt = fPages.begin();
|
||||
|
||||
@@ -66,7 +66,7 @@ UIDriver::ConfigJob()
|
||||
}
|
||||
|
||||
|
||||
long
|
||||
status_t
|
||||
UIDriver::PageSetup(JobData* jobData, PrinterData* printerData,
|
||||
const PrinterCap* printerCap)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ UIDriver::PageSetup(JobData* jobData, PrinterData* printerData,
|
||||
}
|
||||
|
||||
|
||||
long
|
||||
status_t
|
||||
UIDriver::JobSetup(JobData *jobData, PrinterData *printerData,
|
||||
const PrinterCap *printerCap)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user