Fixed C errors from GCC 4.6.

Fixed errors in .c files.

BUG=
TEST=

Review URL: https://webrtc-codereview.appspot.com/373014

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1563 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2012-01-27 13:44:26 +00:00
parent 1f992807eb
commit 2f7740973d
3 changed files with 97 additions and 106 deletions

View File

@ -137,8 +137,6 @@ int main(int argc, char* argv[])
int cur_delay = 0; int cur_delay = 0;
char gns_file[100]; char gns_file[100];
WebRtc_UWord16 rtp_num_init = 0;
int nbTest = 0; int nbTest = 0;
WebRtc_Word16 lostFrame; WebRtc_Word16 lostFrame;
float scale = (float)0.7; float scale = (float)0.7;
@ -376,7 +374,6 @@ int main(int argc, char* argv[])
/* Set initial RTP number */ /* Set initial RTP number */
if (!strcmp ("-RTP_INIT", argv[i])) { if (!strcmp ("-RTP_INIT", argv[i])) {
rtp_num_init = atoi(argv[i + 1]);
i++; i++;
} }
} }

View File

@ -38,7 +38,6 @@
#define FS_SWB 32000 #define FS_SWB 32000
#define FS_WB 16000 #define FS_WB 16000
//#define CHANGE_OUTPUT_NAME //#define CHANGE_OUTPUT_NAME
#ifdef HAVE_DEBUG_INFO #ifdef HAVE_DEBUG_INFO
@ -48,8 +47,6 @@
unsigned long framecnt = 0; unsigned long framecnt = 0;
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
//--- File IO ---- //--- File IO ----
@ -59,11 +56,8 @@ int main(int argc, char* argv[])
char outname[500]; char outname[500];
/* Runtime statistics */ /* Runtime statistics */
double starttime;
double rate; double rate;
double rateRCU; double rateRCU;
double rateLB;
double rateUB;
unsigned long totalbits = 0; unsigned long totalbits = 0;
unsigned long totalBitsRCU = 0; unsigned long totalBitsRCU = 0;
unsigned long totalsmpls =0; unsigned long totalsmpls =0;
@ -93,6 +87,9 @@ int main(int argc, char* argv[])
char outSuffix[500]; char outSuffix[500];
char bitrateFileName[500]; char bitrateFileName[500];
FILE* bitrateFile; FILE* bitrateFile;
double starttime;
double rateLB = 0;
double rateUB = 0;
#endif #endif
FILE* histFile; FILE* histFile;
FILE* averageFile; FILE* averageFile;
@ -250,7 +247,9 @@ valid values are 8 and 16.\n", sampFreqKHz);
printf("Packet-loss Percentage... %d\n", packetLossPercent); printf("Packet-loss Percentage... %d\n", packetLossPercent);
printf("\n"); printf("\n");
#ifdef WIN32
starttime = clock()/(double)CLOCKS_PER_SEC; /* Runtime statistics */ starttime = clock()/(double)CLOCKS_PER_SEC; /* Runtime statistics */
#endif
/* Initialize the ISAC and BN structs */ /* Initialize the ISAC and BN structs */
err = WebRtcIsac_Create(&ISAC_main_inst); err = WebRtcIsac_Create(&ISAC_main_inst);
@ -481,19 +480,20 @@ valid values are 8 and 16.\n", sampFreqKHz);
rate = ((double)totalbits * (sampFreqKHz)) / (double)totalsmpls; rate = ((double)totalbits * (sampFreqKHz)) / (double)totalsmpls;
rateRCU = ((double)totalBitsRCU * (sampFreqKHz)) / (double)totalsmpls; rateRCU = ((double)totalBitsRCU * (sampFreqKHz)) / (double)totalsmpls;
rateLB = 0;
rateUB = 0;
printf("\n\n"); printf("\n\n");
printf("Sampling Rate......................... %d kHz\n", sampFreqKHz); printf("Sampling Rate......................... %d kHz\n", sampFreqKHz);
printf("Payload Limit......................... %d bytes \n", payloadLimit); printf("Payload Limit......................... %d bytes \n", payloadLimit);
printf("Rate Limit............................ %d bits/sec \n", rateLimit); printf("Rate Limit............................ %d bits/sec \n", rateLimit);
#ifdef HAVE_DEBUG_INFO
rateLB = ((double)debugInfo.lbBytes * 8. * (sampFreqKHz)) / (double)totalsmpls;
rateUB = ((double)debugInfo.ubBytes * 8. * (sampFreqKHz)) / (double)totalsmpls;
#endif
#ifdef WIN32 #ifdef WIN32
#ifdef HAVE_DEBUG_INFO
rateLB = ((double)debugInfo.lbBytes * 8. *
(sampFreqKHz)) / (double)totalsmpls;
rateUB = ((double)debugInfo.ubBytes * 8. *
(sampFreqKHz)) / (double)totalsmpls;
#endif
fprintf(bitrateFile, "%d %10u %d %6.3f %6.3f %6.3f\n", fprintf(bitrateFile, "%d %10u %d %6.3f %6.3f %6.3f\n",
sampFreqKHz, sampFreqKHz,
framecnt, framecnt,
@ -502,7 +502,7 @@ valid values are 8 and 16.\n", sampFreqKHz);
rateUB, rateUB,
rate); rate);
fclose(bitrateFile); fclose(bitrateFile);
#endif #endif // WIN32
printf("\n"); printf("\n");
printf("Measured bit-rate..................... %0.3f kbps\n", rate); printf("Measured bit-rate..................... %0.3f kbps\n", rate);

View File

@ -143,7 +143,6 @@ get_arrival_time(
{ {
unsigned int travelTimeMs; unsigned int travelTimeMs;
const int headerSizeByte = 35; const int headerSizeByte = 35;
unsigned int dummy;
int headerRate; int headerRate;
@ -169,14 +168,9 @@ get_arrival_time(
travelTimeMs; travelTimeMs;
} }
dummy = (BN_data->whenPrevPackLeftMs *
(receiverSampFreqHz / 1000)) - BN_data->arrival_time;
BN_data->arrival_time = (BN_data->whenPrevPackLeftMs * BN_data->arrival_time = (BN_data->whenPrevPackLeftMs *
(receiverSampFreqHz / 1000)); (receiverSampFreqHz / 1000));
// if (BN_data->arrival_time < BN_data->sample_count) // if (BN_data->arrival_time < BN_data->sample_count)
// BN_data->arrival_time = BN_data->sample_count; // BN_data->arrival_time = BN_data->sample_count;