# HG changeset patch # User LordOfWar # Date 2009-09-17 22:15:37 # Node ID d34baf50c1b1f39e7f63b8a5e6b8d80735977088 # Parent 25ea5b51c17a556246b36e457b6863e840b9fbc7 -prepare_distrenjob() now uses distrenjob_new() to initilize the job, but then assigns values from the parameters to their proper distrenjob variables -removed unneeded comments/TODOs diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -191,6 +191,7 @@ void prepare_distrenjob(struct distrenjo int counter; struct distrenjob *distrenjob; + distrenjob_new(&distrenjob); distrenjob->type = 1; distrenjob->name = name; @@ -198,17 +199,6 @@ void prepare_distrenjob(struct distrenjo distrenjob->email = email; distrenjob->priority = priority; distrenjob->total_frames = (end_frame - start_frame + 1); // sets the total number of frames in animation for status purposes - distrenjob->frameset = malloc(distrenjob->total_frames); - - distrenjob->assigned_frames = 0; - distrenjob->completed_frames = 0; - - /* @TODO: should the aove be malloc(sizeof(struct frameset) * distrenjob->total_frames? */ - /* - distrenjob->frameset = malloc(sizeof(struct frameset) * numframes); - if(!job->frameset) - fprintf(stderr, "Error allocating memory\n"); - */ /* prepares all the frames by setting that status to "unassigned" */ counter2 = start_frame; @@ -219,6 +209,7 @@ void prepare_distrenjob(struct distrenjo counter2++; } + /* add job to queue */ distrenjob_enqueue(head, distrenjob); general_info.jobs_in_queue++;