src/inc/common.h 1.154
1.154 2009/09/23 18:42:26 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/inc/common.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/common.h,v
retrieving revision 1.153
retrieving revision 1.154
diff -b -B -U 4 -r1.153 -r1.154
--- src/inc/common.h 29 Jun 2009 16:07:34 -0000 1.153
+++ src/inc/common.h 23 Sep 2009 18:42:26 -0000 1.154
@@ -924,13 +924,21 @@
#define writeOne(file, var) mustWrite((file), &(var), sizeof(var))
/* Write out one variable to file. */
void mustRead(FILE *file, void *buf, size_t size);
-/* Read from a file or squawk and die. */
+/* Read size bytes from a file or squawk and die. */
#define mustReadOne(file, var) mustRead((file), &(var), sizeof(var))
/* Read one variable from file or die. */
+void mustGetLine(FILE *file, char *buf, int charCount);
+/* Read at most charCount-1 bytes from file, but stop after newline if one is
+ * encountered. The string in buf is '\0'-terminated. (See man 3 fgets.)
+ * Die if there is an error. */
+
+void mustWriteFd(int fd, void *buf, size_t size);
+/* Write size bytes to file descriptor fd or die. (See man 2 write.) */
+
#define readOne(file, var) (fread(&(var), sizeof(var), 1, (file)) == 1)
/* Read one variable from file. Returns FALSE if can't do it. */
#define memReadOne(pPt, var) memRead((pPt), &(var), sizeof(var))
@@ -985,8 +993,11 @@
struct fileOffsetSize *fileOffsetSizeMerge(struct fileOffsetSize *inList);
/* Returns a new list which is inList transformed to have adjacent blocks
* merged. Best to use this with a sorted list. */
+void mustSystem(char *cmd);
+/* Execute cmd using "sh -c" or die. (See man 3 system.) */
+
int roundingScale(int a, int p, int q);
/* returns rounded a*p/q */
int intAbs(int a);