Changeset - 551b376545b8
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-07-13 22:32:35
ohnobinki@ohnopublishing.net
finished malloc-ifying frame_num_struct_builder()
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -86,6 +86,7 @@ struct blendjob {
 
  char *name;
 
  char *submitter;
 
  char *email;
 
  unsigned int jobnum;
 
  int priority;  // 1 is lowest, 10 is highest, 0 is done
 
  int percent_done;
 
  int completed_frames; // number of completed frames for stats/etc
 
@@ -215,13 +216,16 @@ void frame_num_struct_builder(struct ble
 
  int jobnum_new = highest_jobnum + 1; /* global vars will someday leave us  */
 
	int counter;
 

	
 
	
 
	job->frameset = malloc(sizeof(struct frameset) * numframes);
 
	if(!job->frameset)
 
	  fprintf(stderr, "error allocating memory");
 

	
 
	blendjob[jobnum_new].total_frames = total; // sets the total number of frames in animation for status purposes
 
	job->total_frames = total; // sets the total number of frames in animation for status purposes
 
	job->jobnum = jobnum_new;
 

	
 
	for(counter = 0; counter < total; counter ++)
 
	  /* This builds the array, with the array starting at zero and the frame_num starting at sframe */
 
	  blendjob[jobnum_new].frameset[x].frame_num = counter + 1;
 
	  job->frameset[counter].frame_num = counter + 1;
 
	
 
	highest_jobnum++; // After it has created the job, it adds one to the highest_jobnum interger
 
}
0 comments (0 inline, 0 general)