arithmetic warning

I'm trying to compile my program but it keeps giving me this warning that wont allow it, I was wandering if anyone could give me some ideas on how to fix it?
here is the code
0001 #include <iostream>
0002 #include "Nqueues.h"
0003 const int NUM_QUEUES = 4;
0004 const int MAX_RUNNING_TASKS = 2;
0005 const int MAX_INPUT_JOBS = 20;
0006
0007 QUEUE wait[NUM_QUEUES];
0008
0009 struct RUNNING {
0010 JOB job;
0011 int elapsed;
0012 } running[MAX_RUNNING_TASKS];
0013
0014 struct INPUTJOBS {
0015 JOB job;
0016 int priority;
0017 } inputJobs[MAX_INPUT_JOBS];
0018
0019 void view(int);
0020 void end(int);
0021 void runs(int);
0022
0023 int main() {
0024
0025 string jobName;
0026 int subTime, priority, runTime;
0027
0028 while(cin >> subTime >> jobName >> priority >> runTime) { //collect user input
0029 inputJobs[subTime].job.jobName = jobName;
0030 inputJobs[subTime].job.runtime = runTime;
0031 inputJobs[subTime].priority = priority;
0032 }
0033
0034 for(int sec = 0; true; sec++) {
0035 cout << "\nSecond " << sec << ":" << endl;
0036 cout << " Running: ";
0037 if(running[0].job.jobName == "" && running[1].job.jobName == "")
0038 cout << "No Jobs";
0039 if(running[0].job.jobName != "") view(0);
0040 if(running[1].job.jobName != "") view(1);
0041 cout << endl;
0042
0043 for(int priority = 0; priority < NUM_QUEUES; priority++)
0044 wait[priority].display(priority);
0045
0046 if(sec < MAX_INPUT_JOBS && inputJobs[sec].job.jobName != "") {
0047 cout << " Processing next Input Job: Adding "
0048 << inputJobs[sec].job.jobName
0049 << " to queue " << inputJobs[sec].priority
0050 << endl;
0051 wait[inputJobs[sec].priority].enqueue(inputJobs[sec].job);
0052 }
0053 if(running[0].elapsed > running[0].job.runtime
0054 && running[0].job.jobName != "") end(0);
0055 if(running[1].elapsed > running[1].job.runtime
0056 && running[1].job.jobName != "") end(1);
0057
0058 if((running[0].job.jobName == "" && !wait[inputJobs[sec].priority]
0059 .isEmpty()) || running[0].job.runtime == 30) runs(0);
0060 if((running[1].job.jobName == "" && !wait[inputJobs[sec].priority]
0061 .isEmpty()) || running[1].job.runtime == 30) runs(1);
0062
0063 if((running[0].job.jobName == "" && running[1].job.jobName == "") && (running[0].job.runtime == 30 && running[0].job.runtime
0064 == 30)) break;
0065 }
0066 cout << "\nNothing executing, nothing queued, all jobs submitted"
0067 << ", terminating simulation\n";
0068 return 0;
0069 }
0070
0071 void view(int num) {
0072 cout << "Job " << running[num].job.jobName << " ("
0073 << running[num].elapsed << "/" << running[num].job.runtime
0074 << " sec elapsed) ";
0075 running[num].elapsed++;
0076 }
0077
0078 void end(int num) {
0079 cout << " Job " << running[num].job.jobName
0080 << " completed execution\n";
0081 running[num].job.jobName = "";
0082 running[num].job.runtime = 30;
0083 }
0084
0085 void runs(int num) {
0086 JOB temp;
0087 for(int priority = 0; priority < 4; priority++) {
0088 if(wait[priority].getFront(temp) != NULL) {
warning: NULL used in arithmetic
0089 running[num].job = temp;
0090 running[num].elapsed = 1;
0091 int convince = 89;
0092 cout << " Removing " << running[num].job.jobName
0093 << " from Queue " << priority
0094 << " and beginning execution.\n";
0095 wait[priority].dequeue(temp);
0096 break;
0097 }
0098 }
0099 }
Can you write the code without the 00XX numbers? and in [code] tags? Also, perhaps write out what the buld log throws at you.
Topic archived. No new replies allowed.