[svn r97] Fixed problems on converting string to double and int values.
1.1 --- a/gmyth/src/gmyth_file_transfer.c Fri Nov 17 18:39:47 2006 +0000
1.2 +++ b/gmyth/src/gmyth_file_transfer.c Fri Nov 17 20:07:38 2006 +0000
1.3 @@ -870,7 +870,7 @@
1.4
1.5 g_io_channel_flush( io_channel_control, NULL );
1.6
1.7 - g_static_mutex_lock( &mutex );
1.8 + //g_static_mutex_lock( &mutex );
1.9
1.10 io_cond = g_io_channel_get_buffer_condition( io_channel );
1.11
1.12 @@ -920,6 +920,7 @@
1.13 {
1.14 g_print( "[%s]\t\tsent %d, which is NOT equals to requested size = %d\n\n",
1.15 __FUNCTION__, sent, remaining );
1.16 + remaining = sent;
1.17 break;
1.18
1.19 }
1.20 @@ -1013,7 +1014,7 @@
1.21 }
1.22
1.23 cleanup:
1.24 - g_static_mutex_unlock (&mutex);
1.25 + //g_static_mutex_unlock (&mutex);
1.26 //g_io_channel_flush( io_channel_control, NULL );
1.27
1.28 if ( trash != NULL )
2.1 --- a/gmyth/src/gmyth_scheduler.c Fri Nov 17 18:39:47 2006 +0000
2.2 +++ b/gmyth/src/gmyth_scheduler.c Fri Nov 17 20:07:38 2006 +0000
2.3 @@ -198,9 +198,9 @@
2.4 while((row = mysql_fetch_row (msql_res)) != NULL) {
2.5 schedule = g_new0(ScheduleInfo, 1);
2.6
2.7 - schedule->record_id = atoi (row[0]);
2.8 - schedule->program_id = atoi (row[1]);
2.9 - schedule->channel_id = atoi (row[2]);
2.10 + schedule->record_id = g_ascii_strtoull (row[0], NULL, 10);
2.11 + schedule->program_id = g_ascii_strtoull (row[1], NULL, 10);
2.12 + schedule->channel_id = g_ascii_strtoull (row[2], NULL, 10);
2.13
2.14 /* generate a time_t from a time and a date db field */
2.15 g_string_printf (date_time, "%s %s", row[4], row[3]);
2.16 @@ -265,9 +265,9 @@
2.17 while((row = mysql_fetch_row (msql_res))!=NULL){
2.18 record = g_new0(RecordedInfo, 1);
2.19
2.20 - record->record_id = atoi (row[0]);
2.21 - record->program_id = atoi (row[1]);
2.22 - record->channel_id = atoi (row[2]);
2.23 + record->record_id = g_ascii_strtoull (row[0], NULL, 10);
2.24 + record->program_id = g_ascii_strtoull (row[1], NULL, 10);
2.25 + record->channel_id = g_ascii_strtoull (row[2], NULL, 10);
2.26
2.27 /* the db field time already contains the date. therefore
2.28 * we are not using the date field */
2.29 @@ -525,16 +525,16 @@
2.30 proginfo->chanstr = g_string_new (msql_row[6]);
2.31 proginfo->chansign = g_string_new (msql_row[7]);
2.32 proginfo->channame = g_string_new (msql_row[0]);
2.33 - proginfo->chancommfree = atoi (msql_row[9]);
2.34 + proginfo->chancommfree = g_ascii_strtoull (msql_row[9], NULL, 10);
2.35 proginfo->chanOutputFilters = g_string_new (msql_row[10]);
2.36 proginfo->seriesid = g_string_new (msql_row[11]);
2.37 proginfo->programid = g_string_new (msql_row[12]);
2.38 - proginfo->filesize = atoll (msql_row[13]);
2.39 + proginfo->filesize = g_ascii_strtoull (msql_row[13], NULL, 10);
2.40
2.41 proginfo->lastmodified = gmyth_util_string_to_time (g_string_new (msql_row[14]));
2.42
2.43 - proginfo->stars = atof (msql_row[15]);
2.44 - proginfo->repeat = atoi (msql_row[16]);
2.45 + proginfo->stars = g_ascii_strtod (msql_row[15], NULL);
2.46 + proginfo->repeat = g_ascii_strtoull (msql_row[16], NULL, 10);
2.47
2.48 if (msql_row[17] == NULL) {
2.49 proginfo->originalAirDate = 0;
2.50 @@ -545,15 +545,15 @@
2.51 }
2.52
2.53 proginfo->hostname = g_string_new (msql_row[18]);
2.54 - proginfo->recordid = atoi (msql_row[19]);
2.55 - proginfo->transcoder = atoi (msql_row[20]);
2.56 + proginfo->recordid = g_ascii_strtoull (msql_row[19], NULL, 10);
2.57 + proginfo->transcoder = g_ascii_strtoull (msql_row[20], NULL, 10);
2.58
2.59 //proginfo->spread = -1;
2.60 //proginfo->programflags = proginfo->getProgramFlags();
2.61
2.62 proginfo->recgroup = g_string_new (msql_row[26]);
2.63 proginfo->playgroup = g_string_new (msql_row[21]);
2.64 - proginfo->recpriority = atoi (msql_row[22]);
2.65 + proginfo->recpriority = g_ascii_strtoull (msql_row[22], NULL, 10);
2.66
2.67 proginfo->pathname = g_string_new (msql_row[25]);
2.68