Commit 34e27551 authored by rswindell's avatar rswindell
Browse files

Elminated warnings generated after changing loadmail prototype.

parent fabac905
......@@ -42,7 +42,7 @@
/* If sent is non-zero, it returns the number of mail sent by usernumber */
/* If usernumber is 0, it returns all mail on the system */
/****************************************************************************/
int getmail(scfg_t* cfg, int usernumber, BOOL sent)
int DLLCALL getmail(scfg_t* cfg, int usernumber, BOOL sent)
{
char str[128];
int i=0;
......@@ -213,15 +213,21 @@ void sbbs_t::telluser(smbmsg_t* msg)
/* of pointers to mail_t (message numbers and attributes) */
/* smb_open(&smb) must be called prior */
/****************************************************************************/
mail_t* loadmail(smb_t* smb, long* msgs, uint usernumber
mail_t* DLLCALL loadmail(smb_t* smb, ulong* msgs, uint usernumber
,int which, long mode)
{
ulong l=0;
idxrec_t idx;
mail_t* mail=NULL;
if(msgs==NULL)
return(NULL);
*msgs=0;
if(smb==NULL)
return(NULL);
if(smb_locksmbhdr(smb)!=0) /* Be sure noone deletes or */
return(NULL); /* adds while we're reading */
......@@ -255,7 +261,7 @@ mail_t* loadmail(smb_t* smb, long* msgs, uint usernumber
return(mail);
}
extern "C" void freemail(mail_t* mail)
extern "C" void DLLCALL freemail(mail_t* mail)
{
FREE(mail);
}
......@@ -266,7 +272,7 @@ extern "C" void freemail(mail_t* mail)
void sbbs_t::delallmail(uint usernumber)
{
int i;
long l,msgs,deleted=0;
ulong l,msgs,deleted=0;
mail_t *mail;
smbmsg_t msg;
......
......@@ -48,7 +48,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
int file,mode;
uint i,j,k,conf;
long l,size,msgndx,posts,ex;
long mailmsgs=0;
ulong mailmsgs=0;
ulong totalcdt,totaltime,lastmsg
,files,submsgs,msgs,netfiles=0,preqwk=0;
float f; /* Sparky is responsible */
......@@ -189,7 +189,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
errormsg(WHERE,ERR_OPEN,str,O_CREAT|O_WRONLY|O_TRUNC);
return(false); }
l=filelength(file);
if(!l) {
if(l<1) {
fprintf(qwk,"%-128s",QWK_HEADER);
msgndx=1; }
else
......@@ -231,7 +231,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
/* Pack E-mail, if any */
/***********************/
qwkmail_time=time(NULL);
mail=loadmail(&smb, &mailmsgs,useron.number,0,useron.qwk&QWK_ALLMAIL ? 0
mail=loadmail(&smb,&mailmsgs,useron.number,0,useron.qwk&QWK_ALLMAIL ? 0
: LM_UNREAD);
if(mailmsgs && !(sys_status&SS_ABORT)) {
bputs(text[QWKPackingEmail]);
......@@ -254,7 +254,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
else
mode&=~TO_QNET;
for(l=0;l<mailmsgs;l++) {
for(l=0;(ulong)l<mailmsgs;l++) {
bprintf("\b\b\b\b\b\b\b\b\b\b\b\b%4lu of %-4lu"
,l+1,mailmsgs);
......
......@@ -49,7 +49,7 @@ bool sbbs_t::pack_rep(uint hubnum)
int file,mode;
uint i,j,k;
long l,msgcnt,submsgs,posts,packedmail,netfiles=0,deleted;
long mailmsgs;
ulong mailmsgs;
ulong last,msgs;
post_t HUGE16 *post;
mail_t *mail;
......@@ -73,7 +73,7 @@ bool sbbs_t::pack_rep(uint hubnum)
if((rep=fnopen(&file,str,O_CREAT|O_WRONLY))==NULL) {
errormsg(WHERE,ERR_OPEN,str,O_CREAT|O_WRONLY);
return(false); }
if(!filelength(file)) { /* New REP packet */
if(filelength(file)<1) { /* New REP packet */
sprintf(str,"%-128s",cfg.qhub[hubnum]->id); /* So write header */
fwrite(str,128,1,rep); }
fseek(rep,0L,SEEK_END);
......@@ -97,7 +97,7 @@ bool sbbs_t::pack_rep(uint hubnum)
packedmail=0;
if(mailmsgs) {
lprintf("Packing NetMail for %s", cfg.qhub[hubnum]->id);
for(l=0;l<mailmsgs;l++) {
for(l=0;(ulong)l<mailmsgs;l++) {
// bprintf("\b\b\b\b\b%-5lu",l+1);
msg.idx.offset=mail[l].offset;
......@@ -254,7 +254,7 @@ bool sbbs_t::pack_rep(uint hubnum)
deleted=0;
/* Mark as READ and DELETE */
for(l=0;l<mailmsgs;l++) {
for(l=0;(ulong)l<mailmsgs;l++) {
if(mail[l].time>qwkmail_time)
continue;
msg.idx.offset=0;
......
......@@ -318,7 +318,7 @@ void sbbs_t::qwk_success(ulong msgcnt, char bi, char prepack)
{
char str[128];
int i;
long l,msgs,deleted=0;
ulong l,msgs,deleted=0;
mail_t *mail;
smbmsg_t msg;
......
......@@ -46,7 +46,7 @@ void sbbs_t::readmail(uint usernumber, int which)
,*p,*tp,*sp,ch;
int i,j;
int mismatches=0,act;
long msgs,curmsg;
ulong msgs,curmsg;
long length,l,lm_mode;
ulong last;
bool replied;
......@@ -461,7 +461,7 @@ void sbbs_t::readmail(uint usernumber, int which)
bputs(text[MailOnSystemLstHdr]);
else
bputs(text[MailWaitingLstHdr]);
for(;i<msgs && !msgabort();i++) {
for(;(ulong)i<msgs && !msgabort();i++) {
if(msg.total_hfields)
smb_freemsgmem(&msg);
msg.total_hfields=0;
......@@ -506,10 +506,10 @@ void sbbs_t::readmail(uint usernumber, int which)
smb_unlockmsghdr(&smb,&msg); }
break;
case '>':
for(i=curmsg+1;i<msgs;i++)
for(i=curmsg+1;(ulong)i<msgs;i++)
if(mail[i].subj==msg.idx.subj)
break;
if(i<msgs)
if((ulong)i<msgs)
curmsg=i;
else
domsg=0;
......@@ -525,19 +525,19 @@ void sbbs_t::readmail(uint usernumber, int which)
break;
case '}': /* Search Author forward */
strcpy(str,msg.from);
for(i=curmsg+1;i<msgs;i++)
for(i=curmsg+1;(ulong)i<msgs;i++)
if(mail[i].from==msg.idx.from)
break;
if(i<msgs)
if((ulong)i<msgs)
curmsg=i;
else
domsg=0;
break;
case 'N': /* Got to next un-read message */
for(i=curmsg+1;i<msgs;i++)
for(i=curmsg+1;(ulong)i<msgs;i++)
if(!(mail[i].attr&MSG_READ))
break;
if(i<msgs)
if((ulong)i<msgs)
curmsg=i;
else
domsg=0;
......@@ -554,20 +554,20 @@ void sbbs_t::readmail(uint usernumber, int which)
break;
case ']': /* Search To User forward */
strcpy(str,msg.to);
for(i=curmsg+1;i<msgs;i++)
for(i=curmsg+1;(ulong)i<msgs;i++)
if(mail[i].to==msg.idx.to)
break;
if(i<msgs)
if((ulong)i<msgs)
curmsg=i;
else
domsg=0;
break;
case '[': /* Search To User backward */
strcpy(str,msg.to);
for(i=curmsg-1;i>-1;i--)
for(i=curmsg-1;(ulong)i>-1;i--)
if(mail[i].to==msg.idx.to)
break;
if(i>-1)
if((ulong)i>-1)
curmsg=i;
else
domsg=0;
......@@ -598,7 +598,7 @@ void sbbs_t::readmail(uint usernumber, int which)
i=curmsg;
if(i) i++;
j=i+10;
if(j>msgs)
if((ulong)j>msgs)
j=msgs;
if(which==MAIL_SENT)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment