]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/fty_enum.c
ncurses 5.6 - patch 20080913
[ncurses.git] / form / fty_enum.c
index 054cc4dc862d6f69d0b2b618c873e851cc5b9a76..c96a080db09d4a317622eaf0add1a91aeefef9e6 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_enum.c,v 1.20 2006/04/22 21:33:05 tom Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.22 2007/10/13 19:32:26 tom Exp $")
 
 typedef struct
   {
 
 typedef struct
   {
@@ -56,7 +56,7 @@ enumARG;
 static void *
 Make_Enum_Type(va_list *ap)
 {
 static void *
 Make_Enum_Type(va_list *ap)
 {
-  enumARG *argp = (enumARG *)malloc(sizeof(enumARG));
+  enumARG *argp = typeMalloc(enumARG, 1);
 
   if (argp)
     {
 
   if (argp)
     {
@@ -64,6 +64,7 @@ Make_Enum_Type(va_list *ap)
       char **kp = (char **)0;
       int ccase, cunique;
 
       char **kp = (char **)0;
       int ccase, cunique;
 
+      T((T_CREATE("enumARG %p"), argp));
       argp->kwds = va_arg(*ap, char **);
       ccase = va_arg(*ap, int);
       cunique = va_arg(*ap, int);
       argp->kwds = va_arg(*ap, char **);
       ccase = va_arg(*ap, int);
       cunique = va_arg(*ap, int);
@@ -96,10 +97,13 @@ Copy_Enum_Type(const void *argp)
     {
       const enumARG *ap = (const enumARG *)argp;
 
     {
       const enumARG *ap = (const enumARG *)argp;
 
-      result = (enumARG *)malloc(sizeof(enumARG));
+      result = typeMalloc(enumARG, 1);
 
       if (result)
 
       if (result)
-       *result = *ap;
+       {
+         T((T_CREATE("enumARG %p"), result));
+         *result = *ap;
+       }
     }
   return (void *)result;
 }
     }
   return (void *)result;
 }