[m-dev.] diff: c coding convention mercury_string.c

Peter Ross peter.ross at miscrit.be
Thu Aug 10 19:30:58 AEST 2000


Hi,


===================================================================


Estimated hours taken: 0.1

runtime/mercury_string.c:
    Obey the mercury C coding convention.


Index: mercury_string.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_string.c,v
retrieving revision 1.2
diff -u -r1.2 mercury_string.c
--- mercury_string.c	2000/08/10 09:23:36	1.2
+++ mercury_string.c	2000/08/10 09:30:02
@@ -30,21 +30,23 @@
 
 		/* If that worked, return the string.  */
 		if (n > -1 && n < size) {
-			 break;
+			break;
 		}
 
 		/* Else try again with more space.  */
-		if (n > -1)    /* glibc 2.1 */
-			 /* precisely what is needed */
-			 size = n + 1;
-		else           /* glibc 2.0 */
+		if (n > -1) {	/* glibc 2.1 */
+			size = n + 1; /* precisely what is needed */
+		} else {	/* glibc 2.0 */
 			size *= 2;  /* twice the old size */
+		}
 
 		MR_RESIZE_ARRAY(p, char, size);
 	}
 #else
-		/* It is possible for this buffer to overflow	*/
-		/* and then bad things may happen		*/
+		/* 
+		** It is possible for this buffer to overflow and
+		** then bad things may happen
+		*/
 	char p[40960];
 
 	va_start(ap, fmt);

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list