summaryrefslogtreecommitdiff
path: root/xmllint.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2004-05-05 19:22:30 +0000
committerDaniel Veillard <veillard@src.gnome.org>2004-05-05 19:22:30 +0000
commit3af3b596e387d2444f376805f8c32f1efbe8f96e (patch)
tree0a23ce8cc966e770a7c8349003ad15c1cf258c97 /xmllint.c
parent87076046746f6cfc7716bbebb4aec2c2ed8b3d7c (diff)
downloadlibxml2-3af3b596e387d2444f376805f8c32f1efbe8f96e.tar.gz
Some reformating of recent code, Daniel
Diffstat (limited to 'xmllint.c')
-rw-r--r--xmllint.c51
1 files changed, 30 insertions, 21 deletions
diff --git a/xmllint.c b/xmllint.c
index 527964c4..e333a390 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -177,54 +177,63 @@ static int options = 0;
* *
************************************************************************/
-static void OOM(void) {
+static void
+OOM(void)
+{
fprintf(stderr, "Ran out of memory needs > %d bytes\n", maxmem);
progresult = 9;
}
-static void myFreeFunc(void *mem) {
+static void
+myFreeFunc(void *mem)
+{
xmlMemFree(mem);
}
-static void *myMallocFunc(size_t size) {
+static void *
+myMallocFunc(size_t size)
+{
void *ret;
ret = xmlMemMalloc(size);
if (ret != NULL) {
if (xmlMemUsed() > maxmem) {
- OOM();
- xmlMemFree(ret);
- return(NULL);
- }
+ OOM();
+ xmlMemFree(ret);
+ return (NULL);
+ }
}
- return(ret);
+ return (ret);
}
-static void *myReallocFunc(void *mem, size_t size) {
+static void *
+myReallocFunc(void *mem, size_t size)
+{
void *ret;
ret = xmlMemRealloc(mem, size);
if (ret != NULL) {
if (xmlMemUsed() > maxmem) {
- OOM();
- xmlMemFree(ret);
- return(NULL);
- }
+ OOM();
+ xmlMemFree(ret);
+ return (NULL);
+ }
}
- return(ret);
+ return (ret);
}
-static char *myStrdupFunc(const char *str) {
+static char *
+myStrdupFunc(const char *str)
+{
char *ret;
ret = xmlMemoryStrdup(str);
if (ret != NULL) {
if (xmlMemUsed() > maxmem) {
- OOM();
- xmlFree(ret);
- return(NULL);
- }
+ OOM();
+ xmlFree(ret);
+ return (NULL);
+ }
}
- return(ret);
+ return (ret);
}
-
/************************************************************************
* *
* Internal timing routines to remove the necessity to have *