]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Cast xmalloc return value.
authorBruno Haible <bruno@clisp.org>
Tue, 12 Jun 2001 12:52:42 +0000 (12:52 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 12 Jun 2001 12:52:42 +0000 (12:52 +0000)
src/ChangeLog
src/message.c
src/msgunfmt.c
src/po.c
src/str-list.c

index 1f243a59a005ff6363b2eb00e135d849b399469c..0db91f418caca383b904e9af91f988f3b95ef05c 100644 (file)
@@ -1,3 +1,15 @@
+2001-06-10  Bruno Haible  <haible@clisp.cons.org>
+
+       * message.c (message_alloc): Cast xmalloc return value.
+       (message_list_alloc): Likewise.
+       (message_list_list_alloc): Likewise.
+       (msgdomain_alloc): Likewise.
+       (msgdomain_list_alloc): Likewise.
+       * msgunfmt.c (string32): Likewise.
+       * po.c (po_alloc): Likewise.
+       * str-list.c (string_list_concat): Likewise.
+       (string_list_join): Likewise.
+
 2001-06-10  Bruno Haible  <haible@clisp.cons.org>
 
        * message.h (message_ty): New field 'tmp'.
index 79e31f425b043b79ef4bf07a2b37baeab35e1503..ff8d0712678362bafa4405a880a26ef1036498b8 100644 (file)
@@ -81,7 +81,7 @@ message_alloc (msgid, msgid_plural, msgstr, msgstr_len, pp)
 {
   message_ty *mp;
 
-  mp = xmalloc (sizeof (message_ty));
+  mp = (message_ty *) xmalloc (sizeof (message_ty));
   mp->msgid = msgid;
   mp->msgid_plural = (msgid_plural != NULL ? xstrdup (msgid_plural) : NULL);
   mp->msgstr = msgstr;
@@ -449,7 +449,7 @@ message_list_alloc ()
 {
   message_list_ty *mlp;
 
-  mlp = xmalloc (sizeof (message_list_ty));
+  mlp = (message_list_ty *) xmalloc (sizeof (message_list_ty));
   mlp->nitems = 0;
   mlp->nitems_max = 0;
   mlp->item = NULL;
@@ -608,7 +608,7 @@ message_list_list_alloc ()
 {
   message_list_list_ty *mllp;
 
-  mllp = xmalloc (sizeof (message_list_list_ty));
+  mllp = (message_list_list_ty *) xmalloc (sizeof (message_list_list_ty));
   mllp->nitems = 0;
   mllp->nitems_max = 0;
   mllp->item = NULL;
@@ -711,9 +711,9 @@ msgdomain_ty*
 msgdomain_alloc (domain)
      const char *domain;
 {
-  msgdomain_ty * mdp;
+  msgdomain_ty *mdp;
 
-  mdp = xmalloc (sizeof (msgdomain_ty));
+  mdp = (msgdomain_ty *) xmalloc (sizeof (msgdomain_ty));
   mdp->domain = domain;
   mdp->messages = message_list_alloc ();
   return mdp;
@@ -734,12 +734,13 @@ msgdomain_list_alloc ()
 {
   msgdomain_list_ty *mdlp;
 
-  mdlp = xmalloc (sizeof (msgdomain_list_ty));
+  mdlp = (msgdomain_list_ty *) xmalloc (sizeof (msgdomain_list_ty));
   /* Put the default domain first, so that when we output it,
      we can omit the 'domain' directive.  */
   mdlp->nitems = 1;
   mdlp->nitems_max = 1;
-  mdlp->item = xmalloc (mdlp->nitems_max * sizeof (msgdomain_ty *));
+  mdlp->item =
+    (msgdomain_ty **) xmalloc (mdlp->nitems_max * sizeof (msgdomain_ty *));
   mdlp->item[0] = msgdomain_alloc (MESSAGE_DOMAIN_DEFAULT);
   return mdlp;
 }
index 860aeef288a87cd987475c86ec290b7e7276063b..cd52c85aa5921ec423e748e7a7b0f23e23d3d95d 100644 (file)
@@ -347,7 +347,7 @@ string32 (fp, fn, offset, lengthp)
 
   /* Allocate memory for the string to be read into.  Leave space for
      the NUL on the end.  */
-  buffer = xmalloc (length + 1);
+  buffer = (char *) xmalloc (length + 1);
 
   /* Read in the string.  Complain if there is an error or it comes up
      short.  Add the NUL ourselves.  */
index e148f25cb1a7a47a8fae281c64285da2ae148760..0fac315004cbd2b3d12d2fb8524872b9b8ae22b5 100644 (file)
--- a/src/po.c
+++ b/src/po.c
@@ -58,7 +58,7 @@ po_alloc (pomp)
 {
   po_ty *pop;
 
-  pop = xmalloc (pomp->size);
+  pop = (po_ty *) xmalloc (pomp->size);
   pop->method = pomp;
   if (pomp->constructor)
     pomp->constructor (pop);
index d2c0726d90a447845e278429d9fe7297ac9ba127..a8ab49d5480ed951ba81a4251763bec6740404d3 100644 (file)
@@ -145,7 +145,7 @@ string_list_concat (slp)
   len = 1;
   for (j = 0; j < slp->nitems; ++j)
     len += strlen (slp->item[j]);
-  result = xmalloc (len);
+  result = (char *) xmalloc (len);
   pos = 0;
   for (j = 0; j < slp->nitems; ++j)
     {
@@ -199,7 +199,7 @@ string_list_join (slp)
        ++len;
       len += strlen (slp->item[j]);
     }
-  result = xmalloc (len);
+  result = (char *) xmalloc (len);
   pos = 0;
   for (j = 0; j < slp->nitems; ++j)
     {