Changeset - 5cc750f10d9d
[Not reviewed]
default
0 3 0
Nathan Brink (binki) - 16 years ago 2010-02-14 20:31:47
ohnobinki@ohnopublishing.net
fixed stylistic, pointer access, and integer conversion issues
3 files changed with 17 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -208,7 +208,7 @@ int main(int argc, char *argv[])
 
      /* If the client states that they finished the frame */
 
      	if(clientsays == DISTREN_REQUEST_DONEFRAME){
 
      	  clientstatus = CLIENTSTATUS_IDLE; // Sets the client back to idle
 
      	  finish_frame(general_info.conn, job->jobnum, frame->num); // @TODO: Make sure this actually works.
 
      	  finish_frame(general_info.conn, 0, job->jobnum, frame->num); // @TODO: Make sure this actually works.
 
      	}
 
    }
 

	
src/server/mysql.c
Show inline comments
 
@@ -53,6 +53,16 @@ distrend_mysql_result_t mysqlQuery(distr
 
 */
 
int mysqlResultFree(distrend_mysql_result_t result);
 

	
 
/**
 
   reads an integer mysql field value
 
   @return 0 on success
 
*/
 
int distrend_mysql_getint(MYSQL_ROW row, MYSQL_FIELD_OFFSET column, int32_t *theint)
 
{
 
  *theint = atol(row[column]);
 

	
 
  return 0;
 
}
 

	
 

	
 
struct distrend_mysql_conn
 
@@ -228,14 +238,13 @@ int find_jobframe(distrend_mysql_conn_t 
 
  if(!result)
 
    return 1;
 

	
 
  if ((row = mysql_fetch_row(res)) != NULL)
 
  {
 
	jobkey = row[1];
 
	framenum = row[2];
 
  }
 
  else
 
  row = mysql_fetch_row(result->mysqlresult);
 
  if(!row)
 
	return 1;
 

	
 
  distrend_mysql_getint(row, 1, &jobkey); 
 
  distrend_mysql_getint(row, 2, &framenum);
 
  
 
  mysqlResultFree(result);
 

	
 
  return 0;
src/server/mysql.h
Show inline comments
 
@@ -52,7 +52,7 @@ void finish_frame(distrend_mysql_conn_t 
 
/**
 
   Mark a frame as started in the database and save the time at which it started.
 
 */
 
int start_frame(distrend_mysql_conn_t conn, int32_t slavekey, int32_t jobkey, int32_t framenum);
 
void start_frame(distrend_mysql_conn_t conn, int32_t slavekey, int32_t jobkey, int32_t framenum);
 

	
 
/**
 
   Changes the priority of an existing (and maybe running) job. @arg head I may end up changing the head if job == head
0 comments (0 inline, 0 general)