Removed dup_date and dup_age.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 21 Dec 2002 15:40:22 +0000 (15:40 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 21 Dec 2002 15:40:22 +0000 (15:40 +0000)
gom/event.c
gom/gom.c
gom/gom_internal.h

index d61f6c87d7508c53c3132d67a0bc04bf0b864a87..7d5f92e369ce5d1ed20ad47afe5267f08fb1557e 100644 (file)
@@ -154,14 +154,14 @@ Gedcom_ctxt sub_fam_evt_age_start(_ELT_PARAMS_)
       struct age_value age = GEDCOM_AGE(parsed_value);
       switch (ctxt->ctxt_type) {
        case ELT_SUB_FAM_EVT_HUSB:
-         evt->husband_age = dup_age(age);
+         evt->husband_age = gedcom_new_age_value(&age);
          if (! evt->husband_age) {
            MEMORY_ERROR;
            err = 1;
          }
          break;
        case ELT_SUB_FAM_EVT_WIFE:
-         evt->wife_age = dup_age(age);
+         evt->wife_age = gedcom_new_age_value(&age);
          if (! evt->wife_age) {
            MEMORY_ERROR;
            err = 1;
index a81777810990eb17b713ebf39fab7d4e9ddabbdf..302fc06d590903b1fb27d2b2da6ce26bf48f4e3a 100644 (file)
--- a/gom/gom.c
+++ b/gom/gom.c
@@ -242,27 +242,3 @@ void set_xref_type(struct xref_value* xr, const char *str)
   else
     xr->type = XREF_ANY;
 }
-
-struct date_value* dup_date(struct date_value dv)
-{
-  struct date_value* dv_ptr;
-  dv_ptr = (struct date_value*) malloc(sizeof(struct date_value));
-  if (! dv_ptr)
-    MEMORY_ERROR;
-  else {
-    memcpy(dv_ptr, &dv, sizeof(struct date_value));
-  }
-  return dv_ptr;
-}
-
-struct age_value* dup_age(struct age_value age)
-{
-  struct age_value* age_ptr;
-  age_ptr = (struct age_value*) malloc(sizeof(struct age_value));
-  if (! age_ptr)
-    MEMORY_ERROR;
-  else {
-    memcpy(age_ptr, &age, sizeof(struct age_value));
-  }
-  return age_ptr;
-}
index 01dde5cad0796b41dd93f5f976505dd18938816c..46c42a100815edb60b732c60de7fa25decb014e5 100644 (file)
@@ -109,9 +109,6 @@ void def_elt_end(Gedcom_elt elt, Gedcom_ctxt parent,
                 Gedcom_ctxt self, Gedcom_val parsed_value);
 void set_xref_type(struct xref_value *xr, const char* str);
 
-struct date_value* dup_date(struct date_value dv);
-struct age_value*  dup_age(struct age_value age);
-
 /* Doubly-linked list, but last rec->next is NULL (doesn't go to first rec) */
 #define LINK_CHAIN_ELT(STRUCTTYPE, FIRSTVAL, VAL)                             \
   {                                                                           \
@@ -267,7 +264,7 @@ void NULL_DESTROY(void* anything);
         = SAFE_CTXT_CAST(STRUCTTYPE, (Gom_ctxt)parent);                       \
       if (obj) {                                                              \
         struct date_value dv = GEDCOM_DATE(parsed_value);                     \
-        obj->FIELD = dup_date(dv);                                            \
+        obj->FIELD = gedcom_new_date_value(&dv);                              \
         if (! obj->FIELD)                                                     \
          MEMORY_ERROR;                                                       \
         else                                                                  \
@@ -288,7 +285,7 @@ void NULL_DESTROY(void* anything);
         = SAFE_CTXT_CAST(STRUCTTYPE, (Gom_ctxt)parent);                       \
       if (obj) {                                                              \
         struct age_value age = GEDCOM_AGE(parsed_value);                      \
-        obj->FIELD = dup_age(age);                                            \
+        obj->FIELD = gedcom_new_age_value(&age);                              \
         if (! obj->FIELD)                                                     \
          MEMORY_ERROR;                                                       \
         else                                                                  \