X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fzebramap.c;h=3d75a4160ea8b2a51c9e2a0fb26ccc8459f7ed9f;hb=6b0310a64df542131c2f4abded39f35844235e4d;hp=9e1bae9b5eb1eb196bc1126f0e12dcda0e39ea12;hpb=18ceebf9dad34b382ffc84171f9e33246b8e075c;p=idzebra-moved-to-github.git diff --git a/util/zebramap.c b/util/zebramap.c index 9e1bae9..3d75a41 100644 --- a/util/zebramap.c +++ b/util/zebramap.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebramap.c,v $ - * Revision 1.13 1999-02-18 15:01:04 adam + * Revision 1.15 1999-05-26 07:49:14 adam + * C++ compilation. + * + * Revision 1.14 1999/02/19 10:37:40 adam + * Minor fix. + * + * Revision 1.13 1999/02/18 15:01:04 adam * Structure=key uses register type 0. * * Revision 1.12 1999/02/12 13:29:25 adam @@ -123,7 +129,7 @@ static void zebra_map_read (ZebraMaps zms, const char *name) zm = &zms->map_list; else zm = &(*zm)->next; - *zm = nmem_malloc (zms->nmem, sizeof(**zm)); + *zm = (struct zebra_map *) nmem_malloc (zms->nmem, sizeof(**zm)); (*zm)->reg_id = argv[1][0]; (*zm)->maptab_name = NULL; (*zm)->maptab = NULL; @@ -137,7 +143,7 @@ static void zebra_map_read (ZebraMaps zms, const char *name) zm = &zms->map_list; else zm = &(*zm)->next; - *zm = nmem_malloc (zms->nmem, sizeof(**zm)); + *zm = (struct zebra_map *) nmem_malloc (zms->nmem, sizeof(**zm)); (*zm)->reg_id = argv[1][0]; (*zm)->maptab_name = NULL; (*zm)->type = ZEBRA_MAP_TYPE_SORT; @@ -174,18 +180,18 @@ static void zebra_map_read (ZebraMaps zms, const char *name) static void zms_map_handle (void *p, const char *name, const char *value) { - ZebraMaps zms = p; + ZebraMaps zms = (ZebraMaps) p; zebra_map_read (zms, value); } ZebraMaps zebra_maps_open (Res res) { - ZebraMaps zms = xmalloc (sizeof(*zms)); + ZebraMaps zms = (ZebraMaps) xmalloc (sizeof(*zms)); int i; zms->nmem = nmem_create (); - zms->tabpath = nmem_strdup (zms->nmem, res_get (res, "profilePath")); + zms->tabpath = nmem_strdup (zms->nmem, res_get_def (res, "profilePath", ".")); zms->map_list = NULL; zms->temp_map_str[0] = '\0'; @@ -194,7 +200,7 @@ ZebraMaps zebra_maps_open (Res res) zms->temp_map_ptr[0] = zms->temp_map_str; zms->temp_map_ptr[1] = NULL; - zms->lookup_array = + zms->lookup_array = (struct zebra_map**) nmem_malloc (zms->nmem, sizeof(*zms->lookup_array)*256); for (i = 0; i<256; i++) zms->lookup_array[i] = 0; @@ -213,7 +219,7 @@ chrmaptab zebra_charmap_get (ZebraMaps zms, unsigned reg_id) struct zebra_map *zm = zebra_map_get (zms, reg_id); if (!zm) { - zm = nmem_malloc (zms->nmem, sizeof(*zm)); + zm = (struct zebra_map *) nmem_malloc (zms->nmem, sizeof(*zm)); logf (LOG_WARN, "Unknown register type: %c", reg_id); zm->reg_id = reg_id;