Changed ulong type to uint32_t

This commit is contained in:
Ianos Gnatiuc
2005-10-20 21:41:32 +00:00
parent 44c26c3b0a
commit c5734978fa
42 changed files with 298 additions and 302 deletions

View File

@@ -386,14 +386,14 @@ void CfgSeqOutRun_Error() {
void CfgSeqOutRun() {
char *p;
ulong s = 0;
uint32_t s = 0;
if(not isdigit((int)(*val))) {
CfgSeqOutRun_Error();
return;
}
s = (ulong)atol(val);
s = (uint32_t)atol(val);
p = val;
while(isdigit((int)(*p)))
p++;

View File

@@ -550,7 +550,7 @@ enum {
// The Message Browser
struct MLst {
ulong msgno;
uint32_t msgno;
byte high;
char num[8];
char marks[3];

View File

@@ -315,7 +315,7 @@ public:
Semaphore semaphore;
Path seqdir;
int seqmsgid;
ulong seqoutrun;
uint32_t seqoutrun;
int sharemode; // share;
bool showdeleted;
Path soundpath;

View File

@@ -86,7 +86,7 @@ class gfileselect : public gwinpick {
void print_line(uint idx, uint pos, bool isbar);
void scroll(int where);
bool handle_key();
const char *gensize(ulong size);
const char *gensize(uint32_t size);
public:
@@ -145,7 +145,7 @@ void gfileselect::do_delayed() {
#define KFIX(A) (int) (((A) * 1000.0 / 1024.0) / 10)
const char *gfileselect::gensize(ulong size) {
const char *gfileselect::gensize(uint32_t size) {
static char ret[16];

View File

@@ -95,7 +95,7 @@ bool FindString(GMsg* msg, const char* prompt, int what) {
GFTRK("FindString");
static ulong lastfound = 0;
static uint32_t lastfound = 0;
bool result = false;
bool breakloop = true;
@@ -107,7 +107,7 @@ bool FindString(GMsg* msg, const char* prompt, int what) {
lastfound = AA->Msgn.CvtReln(AA->lastread());
w_progress(MODE_NEW, C_INFOW, AA->lastread(), AA->Msgn.Count(), LNG->AdvancedSearch);
ulong tmpmsgno;
uint32_t tmpmsgno;
int margin = CFG->dispmargin-(int)CFG->switches.get(disppagebar);

View File

@@ -118,8 +118,8 @@ void DispHeader(GMsg* msg, bool prn, FILE* fp, int width) {
// Generate message number and reply links string
char* ptr = buf1;
int list_max = msg->link.list_max();
ulong* replies = (ulong*)throw_calloc(list_max+1, sizeof(ulong));
ulong replyto, replynext;
uint32_t* replies = (uint32_t*)throw_calloc(list_max+1, sizeof(uint32_t));
uint32_t replyto, replynext;
if(CFG->switches.get(disprealmsgno)) {
ptr += sprintf(ptr, " %-5.5s: #%lu [%u]", LNG->Msg, msg->msgno, AA->Msgn.Count()+(msg->attr.nwm() ? 1 : 0));
replyto = msg->link.to();

View File

@@ -48,7 +48,7 @@ void ResetMsg(GMsg* msg) {
// ------------------------------------------------------------------
int Area::LoadHdr(GMsg* msg, ulong msgno, bool enable_recode) {
int Area::LoadHdr(GMsg* msg, uint32_t msgno, bool enable_recode) {
ResetMsg(msg);
msg->msgno = msgno;
@@ -87,7 +87,7 @@ int Area::LoadHdr(GMsg* msg, ulong msgno, bool enable_recode) {
// ------------------------------------------------------------------
int Area::LoadMsg(GMsg* msg, ulong msgno, int margin, int mode) {
int Area::LoadMsg(GMsg* msg, uint32_t msgno, int margin, int mode) {
ResetMsg(msg);
msg->msgno = msgno;

View File

@@ -418,7 +418,7 @@ bool GMsgList::handle_key() {
case KK_ListMark:
{
ulong temp = AA->Mark.Find(mlst[index]->msgno);
uint32_t temp = AA->Mark.Find(mlst[index]->msgno);
if(not temp) {
AA->Mark.Add(mlst[index]->msgno);
update_marks(mlst[index]);
@@ -432,7 +432,7 @@ bool GMsgList::handle_key() {
case KK_ListUnmark:
{
ulong temp = AA->Mark.Find(mlst[index]->msgno);
uint32_t temp = AA->Mark.Find(mlst[index]->msgno);
if(temp) {
AA->Mark.DelReln(temp);
update_marks(mlst[index]);
@@ -446,7 +446,7 @@ bool GMsgList::handle_key() {
case KK_ListToggleMark:
{
ulong temp = AA->Mark.Find(mlst[index]->msgno);
uint32_t temp = AA->Mark.Find(mlst[index]->msgno);
if(temp) {
AA->Mark.DelReln(temp);
}
@@ -667,12 +667,12 @@ void MessageBrowse() {
class ThreadEntry {
public:
ulong msgno;
ulong replyto;
ulong reply1st;
ulong replynext;
ulong replytoindex;
ulong level;
uint32_t msgno;
uint32_t replyto;
uint32_t reply1st;
uint32_t replynext;
uint32_t replytoindex;
uint32_t level;
};
#define MAX_LEVEL 20
@@ -687,8 +687,8 @@ private:
ThreadEntry t;
void BuildThreadIndex(dword msgno);
void recursive_build(ulong msgn, ulong rn, ulong level);
void GenTree(char* buf2, int idx, ulong maxlev);
void recursive_build(uint32_t msgn, uint32_t rn, uint32_t level);
void GenTree(char* buf2, int idx, uint32_t maxlev);
void update_title();
bool NextThread(bool next);
@@ -790,7 +790,7 @@ void GThreadlist::close() {
// ------------------------------------------------------------------
void GThreadlist::GenTree(char* buf, int idx, ulong maxlev) {
void GThreadlist::GenTree(char* buf, int idx, uint32_t maxlev) {
#ifdef KOI8
static char graph[4]="<EFBFBD><EFBFBD><EFBFBD>";
@@ -841,7 +841,7 @@ void GThreadlist::GenTree(char* buf, int idx, ulong maxlev) {
void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
char buf[256];
ulong maxlev = (100*window.width()+h_offset+1)/2;
uint32_t maxlev = (100*window.width()+h_offset+1)/2;
#if defined(__USE_ALLOCA__)
char *buf2 = (char*)alloca(maxlev*2+2);
#else
@@ -950,9 +950,9 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
// ------------------------------------------------------------------
void GThreadlist::recursive_build(ulong msgn, ulong rn, ulong level) {
void GThreadlist::recursive_build(uint32_t msgn, uint32_t rn, uint32_t level) {
ulong oldmsgno = msg.msgno;
uint32_t oldmsgno = msg.msgno;
if(AA->Msgn.ToReln(msgn) and AA->LoadHdr(&msg, msgn)) {
@@ -1007,8 +1007,8 @@ void GThreadlist::BuildThreadIndex(dword msgn) {
AA->LoadHdr(&msg, msgn);
ulong msgno = msg.link.to();
ulong prevmsgno = msgn;
uint32_t msgno = msg.link.to();
uint32_t prevmsgno = msgn;
// Search backwards
while(AA->Msgn.ToReln(msgno)) {
@@ -1136,7 +1136,7 @@ bool GThreadlist::handle_key() {
case KK_ListToggleMark:
{
ulong temp = AA->Mark.Find(list[index].msgno);
uint32_t temp = AA->Mark.Find(list[index].msgno);
if(temp) {
AA->Mark.DelReln(temp);
}

View File

@@ -41,7 +41,7 @@ int NextMarkedmsg(int direction, GMsg* msg) {
if(tag.Count()) {
uint n;
ulong msgno = 0;
uint32_t msgno = 0;
if(direction == DIR_NEXT) {
if(msg->msgno != tag[tag.Count()-1]) {
for(n=0; n<tag.Count(); n++) {
@@ -124,7 +124,7 @@ void MarkMsgs_Toggle() {
void MarkMsgs_All() {
AA->Mark.Resize(AA->Msgn.Count());
memcpy(AA->Mark.tag, AA->Msgn.tag, AA->Msgn.Count()*sizeof(ulong));
memcpy(AA->Mark.tag, AA->Msgn.tag, AA->Msgn.Count()*sizeof(uint32_t));
}
@@ -134,7 +134,7 @@ void MarkMsgs_New() {
uint oldmarks = AA->Mark.Count();
AA->Mark.Resize(AA->Mark.Count()+(AA->Msgn.Count() - AA->lastread()));
memcpy(AA->Mark.tag+oldmarks, AA->Msgn.tag+AA->lastread(), (AA->Msgn.Count()-AA->lastread())*sizeof(ulong));
memcpy(AA->Mark.tag+oldmarks, AA->Msgn.tag+AA->lastread(), (AA->Msgn.Count()-AA->lastread())*sizeof(uint32_t));
AA->Mark.Sort();
AA->Mark.ElimDups();
}
@@ -146,7 +146,7 @@ void MarkMsgs_Old() {
uint oldmarks = AA->Mark.Count();
AA->Mark.Resize(AA->Mark.Count() + (AA->lastread() - 1));
memcpy(AA->Mark.tag+oldmarks, AA->Msgn.tag, (AA->lastread()-1)*sizeof(ulong));
memcpy(AA->Mark.tag+oldmarks, AA->Msgn.tag, (AA->lastread()-1)*sizeof(uint32_t));
AA->Mark.Sort();
AA->Mark.ElimDups();
}
@@ -218,7 +218,7 @@ void MarkMsgs_Txt(int item, char* markstring) {
// ------------------------------------------------------------------
static void recursive_mark(GMsg* msg, ulong msgno) {
static void recursive_mark(GMsg* msg, uint32_t msgno) {
int i;
gmsg_links templink;
@@ -259,7 +259,7 @@ void MarkMsgs_Thread(GMsg* msg) {
AA->Mark.Add(msg->msgno);
ulong msgno = msg->link.to();
uint32_t msgno = msg->link.to();
while(AA->Msgn.ToReln(msgno)) { // Search backwards
AA->Mark.Add(msgno);

View File

@@ -28,20 +28,20 @@
#include <genmsgid.h>
// ------------------------------------------------------------------
static ulong msgcount = 0;
static uint32_t msgcount = 0;
// ------------------------------------------------------------------
ulong getClassicMsgId() {
uint32_t getClassicMsgId() {
return gtime(NULL)+(msgcount++);
}
// ------------------------------------------------------------------
ulong getMsgId() {
uint32_t getMsgId() {
ulong id;
uint32_t id;
char *err;
if((CFG->seqmsgid == YES) or ((CFG->seqmsgid == MAYBE) and (*CFG->seqdir != NUL))) {

View File

@@ -54,7 +54,7 @@ std::string &strtrimline(std::string &p) {
// ------------------------------------------------------------------
const char* get_subject_re_info(const char* s, ulong& n) {
const char* get_subject_re_info(const char* s, uint32_t& n) {
if(toupper(*s) == 'R' and tolower(s[1]) == 'e') {
@@ -67,7 +67,7 @@ const char* get_subject_re_info(const char* s, ulong& n) {
while(isdigit(*d))
d++;
if(*d == ':') {
n = (ulong)atol(s + 3);
n = (uint32_t)atol(s + 3);
return d + 1;
}
}
@@ -332,7 +332,7 @@ static void MakeMsg3(int& mode, GMsg* msg) {
}
AA->Close();
A->Open();
ulong oldmsgno = msg->msgno;
uint32_t oldmsgno = msg->msgno;
A->NewMsgno(msg);
A->SaveMsg(GMSG_NEW|GMSG_NOLSTUPD, msg);
A->Close();
@@ -670,7 +670,7 @@ static void MakeMsg2(int& mode, int& status, int& forwstat, int& topline, GMsg*
// ------------------------------------------------------------------
static void GetLastLink(GMsg* msg, ulong& msgno) {
static void GetLastLink(GMsg* msg, uint32_t& msgno) {
GMsg* uplink = (GMsg*)throw_calloc(1, sizeof(GMsg));
@@ -705,7 +705,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
GMsg* msg = (GMsg*)throw_calloc(1, sizeof(GMsg));
GMsg* reply = (GMsg*)throw_calloc(1, sizeof(GMsg));
GMsg* cmpmsg = (GMsg*)throw_calloc(1, sizeof(GMsg));
ulong reply_msgno = 0;
uint32_t reply_msgno = 0;
// Keep copy of original aka for later restoration
Addr origaka = AL.AreaIdToPtr(OrigArea)->aka();
@@ -929,7 +929,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
if(AA->Replyre() or AA->isinternet()) {
ulong number;
uint32_t number;
const char* r = get_subject_re_info(msg->re, number);
if(r) {
if(AA->Replyre() == REPLYRE_NUMERIC and not AA->isinternet()) {
@@ -945,7 +945,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
}
else {
char* r;
ulong number;
uint32_t number;
char* ptr = msg->re;
do {
r = (char*)get_subject_re_info(ptr, number);
@@ -1140,7 +1140,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
if(CurrArea == OrigArea and (mode == MODE_QUOTE or mode == MODE_REPLYCOMMENT or mode == MODE_REPLY)) {
if(AA->Msgn.ToReln(reply_msgno)) {
if(AA->LoadHdr(reply, reply_msgno, false)) {
ulong replynext;
uint32_t replynext;
bool ok2save = false;
if(streql(AA->basetype(), "SQUISH")) {
if(reply->link.first()) {

View File

@@ -281,7 +281,7 @@ int ExportQWK();
char* GetCurrQuotebuf(char* quotebuf);
int MsgIsTwit(GMsg* msg, bool& istwitto, bool& istwitsubj);
ulong MsgHasReplies(GMsg* msg);
uint32_t MsgHasReplies(GMsg* msg);
gkey ViewMessage(int istwit=NOT_TWIT);
int LoadMessage(GMsg* msg, int margin);
#ifdef OLD_STYLE_HEADER
@@ -430,8 +430,8 @@ void edit_addressbook(GMsg* msg);
// ------------------------------------------------------------------
// GEMSGID prototypes
ulong getMsgId();
ulong getClassicMsgId();
uint32_t getMsgId();
uint32_t getClassicMsgId();
// ------------------------------------------------------------------

View File

@@ -1045,7 +1045,7 @@ void Reader() {
// ------------------------------------------------------------------
// Determine if the message has replies
ulong MsgHasReplies(GMsg* msg) {
uint32_t MsgHasReplies(GMsg* msg) {
if(msg->link.first())
return msg->link.first();
@@ -1277,7 +1277,7 @@ void ToggleMarkRead() {
void GotoBookMark() {
if(AA->bookmark) {
ulong temp = reader_msg->msgno;
uint32_t temp = reader_msg->msgno;
AA->set_lastread(AA->Msgn.ToReln(AA->bookmark));
AA->bookmark = temp;
}
@@ -1397,7 +1397,7 @@ void GotoReplies() {
ReplySel* rlist = (ReplySel*)throw_calloc(list_max+3, sizeof(ReplySel));
for(int n=0; n<list_max+2; n++) {
ulong msgn = n ? ((n!=list_max+1) ? msg->link.list(n-1) : msg->link.next()) : msg->link.first();
uint32_t msgn = n ? ((n!=list_max+1) ? msg->link.list(n-1) : msg->link.next()) : msg->link.first();
uint reln = AA->Msgn.ToReln(msgn);
if(reln) {
if(CFG->replylinklist == REPLYLINKLIST_FULL)
@@ -1408,7 +1408,7 @@ void GotoReplies() {
if((cursorbar == -1) and (0 == rmsg->timesread) and (CFG->switches.get(highlightunread)))
cursorbar = replies;
rlist[replies].msgno[0] = (n==list_max+1) ? '*' : '+';
ulong msgno = CFG->switches.get(disprealmsgno) ? msgn : reln;
uint32_t msgno = CFG->switches.get(disprealmsgno) ? msgn : reln;
sprintf(rlist[replies].msgno+1, "%lu", msgno);
maxmsgno = MaxV(maxmsgno, (uint)strlen(rlist[replies].msgno+1));
strcpy(rlist[replies].name, rmsg->by);

View File

@@ -290,8 +290,8 @@ void GotoMsgno() {
char buf[150];
char* ptr = buf;
int list_max = reader_msg->link.list_max();
ulong* replies = (ulong*)throw_calloc(list_max+1, sizeof(ulong));
ulong replyto, replynext;
uint32_t* replies = (uint32_t*)throw_calloc(list_max+1, sizeof(uint32_t));
uint32_t replyto, replynext;
if(CFG->switches.get(disprealmsgno)) {
ptr += sprintf(ptr, " %-5.5s: %s %u", LNG->MsgReal, LNG->of, AA->Msgn.Count());
replyto = reader_msg->link.to();

View File

@@ -59,9 +59,9 @@ struct gusrbaseentry {
char voicephone[40];
char faxphone[40];
ulong firstdate;
ulong lastdate;
ulong times;
uint32_t firstdate;
uint32_t lastdate;
uint32_t times;
char homepage[128];
byte group;

View File

@@ -151,8 +151,8 @@ void GMsgHeaderView::Paint() {
// Generate message number and reply links string
char* ptr = buf;
int list_max = msg->link.list_max();
ulong* replies = (ulong*)throw_calloc(list_max+1, sizeof(ulong));
ulong replyto, replynext;
uint32_t* replies = (uint32_t*)throw_calloc(list_max+1, sizeof(uint32_t));
uint32_t replyto, replynext;
if(CFG->switches.get(disprealmsgno)) {
ptr += sprintf(ptr, " %-5.5s: #%u [%u]", LNG->Msg, msg->msgno, area->Msgn.Count()+(msg->attr.nwm() ? 1 : 0));
replyto = msg->link.to();

View File

@@ -375,12 +375,12 @@ public:
GTag PMrk; // Personal mail marks
GTag Expo; // Messages to be exported
ulong bookmark; // Current bookmark message number
uint32_t bookmark; // Current bookmark message number
uint unread; // Number of unread messages at last scan
uint lastread() const; // Number of last message read
ulong lastreadentry() const; // Lastread message number at entry to area
uint lastread() const; // Number of last message read
uint32_t lastreadentry() const; // Lastread message number at entry to area
void set_lastread(uint lr);
@@ -508,8 +508,8 @@ public:
void ScanArea();
void ScanAreaPM();
int LoadHdr(GMsg* msg, ulong msgno, bool enable_recode = true);
int LoadMsg(GMsg* msg, ulong msgno, int margin, int mode=0);
int LoadHdr(GMsg* msg, uint32_t msgno, bool enable_recode = true);
int LoadMsg(GMsg* msg, uint32_t msgno, int margin, int mode=0);
void SaveHdr(int mode, GMsg* msg);
void SaveMsg(int mode, GMsg* msg);
@@ -634,8 +634,8 @@ inline int Area::isinternet() const { return area->isinternet(); }
inline int Area::isqwk() const { return area->isqwk(); }
inline int Area::issoup() const { return area->issoup(); }
inline uint Area::lastread() const { return area->lastread; }
inline ulong Area::lastreadentry() const { return area->lastreadentry; }
inline uint Area::lastread() const { return area->lastread; }
inline uint32_t Area::lastreadentry() const { return area->lastreadentry; }
inline void Area::set_lastread(uint lr) { area->lastread = lr; }
inline void Area::SetBookmark(uint __relno) { bookmark = Msgn.CvtReln(__relno); /*Book.Add(bookmark);*/ }