src/hg/protein/pbCalResStd/pbCalResStd.c 1.11
1.11 2009/09/23 18:42:25 angie
Fixed compiler warnings from gcc 4.3.3, mostly about system calls whose return values weren't checked and non-literal format strings with no args.
Index: src/hg/protein/pbCalResStd/pbCalResStd.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/protein/pbCalResStd/pbCalResStd.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -B -U 4 -r1.10 -r1.11
--- src/hg/protein/pbCalResStd/pbCalResStd.c 3 Sep 2008 19:20:59 -0000 1.10
+++ src/hg/protein/pbCalResStd/pbCalResStd.c 23 Sep 2009 18:42:25 -0000 1.11
@@ -270,23 +270,23 @@
o1 = mustOpen("pbAnomLimit.tab", "w");
for (j=0; j<20; j++)
{
safef(temp_str, sizeof(temp_str), "cat %c.txt|sort|uniq > %c.srt", aaAlphabet[j], aaAlphabet[j]);
- system(temp_str);
+ mustSystem(temp_str);
/* figure out how many unique entries */
safef(temp_str, sizeof(temp_str), "wc %c.srt > %c.tmp", aaAlphabet[j], aaAlphabet[j]);
- system(temp_str);
+ mustSystem(temp_str);
safef(temp_str, sizeof(temp_str), "%c.tmp", aaAlphabet[j]);
o3 = mustOpen(temp_str, "r");
- fgets(temp_str, 1000, o3);
+ mustGetLine(o3, temp_str, 1000);
chp = temp_str;
while (*chp == ' ') chp++;
while (*chp != ' ') chp++;
*chp = '\0';
sscanf(temp_str, "%d", &sortedCnt);
safef(temp_str, sizeof(temp_str), "rm %c.tmp", aaAlphabet[j]);
- system(temp_str);
+ mustSystem(temp_str);
/* cal hi and low cutoff threshold */
ilow = (int)((float)sortedCnt * 0.025);
ihi = (int)((float)sortedCnt * 0.975);
@@ -295,23 +295,23 @@
o2 = mustOpen(temp_str, "r");
i=0;
for (i=0; i<ilow; i++)
{
- fgets(temp_str, 1000, o2);
+ mustGetLine(o2, temp_str, 1000);
}
sscanf(temp_str, "%f", &fvalue1);
- fgets(temp_str, 1000, o2);
+ mustGetLine(o2, temp_str, 1000);
sscanf(temp_str, "%f", &fvalue2);
p1 = (fvalue1 + fvalue2)/2.0;
for (i=ilow+1; i<ihi; i++)
{
- fgets(temp_str, 1000, o2);
+ mustGetLine(o2, temp_str, 1000);
}
sscanf(temp_str, "%f", &fvalue1);
- fgets(temp_str, 1000, o2);
+ mustGetLine(o2, temp_str, 1000);
sscanf(temp_str, "%f", &fvalue2);
p2 = (fvalue1 + fvalue2)/2.0;
carefulClose(&o2);