From 03b00294a8f57bfd02c81e7ac4ee2bb280177f98 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 7 Nov 2013 11:14:05 +0100 Subject: [PATCH] Remove unused code sections --- src/facet.c | 22 ++--------------- src/iconv_decode_iso5426.c | 59 +++----------------------------------------- src/odr.c | 9 ------- src/siconv.c | 6 ----- src/solrtransform.c | 14 ----------- 5 files changed, 6 insertions(+), 104 deletions(-) diff --git a/src/facet.c b/src/facet.c index b65091a..7709250 100644 --- a/src/facet.c +++ b/src/facet.c @@ -175,7 +175,8 @@ void yaz_facet_attr_get_z_attributes(const Z_AttributeList *attributes, sprintf(av->useattrbuff, ODR_INT_PRINTF, *ae-> attributeType); av->errstring = av->useattrbuff; - yaz_log(YLOG_WARN, "Unsupported attribute type %s", av->useattrbuff); + yaz_log(YLOG_WARN, "Unsupported attribute type %s", + av->useattrbuff); /* would like to give a better message, but the standard */ /* tells me to return the attribute type */ } @@ -183,27 +184,8 @@ void yaz_facet_attr_get_z_attributes(const Z_AttributeList *attributes, return; /* no need to dig deeper, return on first error */ } return; -} /* facetattrs */ - -#if 0 -Z_Term *term_create(ODR odr, const char *cstr) -{ - Z_Term *term = odr_malloc(odr, sizeof(*term)); - term->which = Z_Term_characterString; - term->u.characterString = odr_strdup(odr, cstr); - return term; } -Z_FacetTerm* facet_term_create(ODR odr, Z_Term *term, int freq) -{ - Z_FacetTerm *facet_term = odr_malloc(odr, sizeof(*facet_term)); - facet_term->count = odr_malloc(odr, sizeof(*facet_term->count)); - facet_term->term = term; - *facet_term->count = freq; - return facet_term; -} -#endif - Z_FacetTerm *facet_term_create_cstr(ODR odr, const char *cstr, Odr_int freq) { Z_FacetTerm *facet_term = odr_malloc(odr, sizeof(*facet_term)); diff --git a/src/iconv_decode_iso5426.c b/src/iconv_decode_iso5426.c index 1a883fc..c92abd7 100644 --- a/src/iconv_decode_iso5426.c +++ b/src/iconv_decode_iso5426.c @@ -109,26 +109,6 @@ static unsigned long read_iso5426(yaz_iconv_t cd, yaz_iconv_decoder_t d, return x; } -#if 0 -/* not used */ -static unsigned long read_iso5426s(yaz_iconv_t cd, yaz_iconv_decoder_t d, - unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - struct decoder_data *data = (struct decoder_data *) d->data; - unsigned long x = read_iso5426(cd, d, inp, inbytesleft, no_read); - if (x && data->comb_size == 1) - { - if (yaz_iso_8859_1_lookup_x12(x, data->comb_x[0], &x)) - { - *no_read += data->comb_no_read[0]; - data->comb_size = 0; - } - } - return x; -} -#endif - static unsigned long yaz_read_iso5426_comb(yaz_iconv_t cd, struct decoder_data *data, unsigned char *inp, @@ -195,44 +175,13 @@ static unsigned long yaz_read_iso5426_comb(yaz_iconv_t cd, { case 'B': /* Basic ASCII */ case 's': /* ASCII */ - x = yaz_iso5426_42_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); + x = yaz_iso5426_42_conv(inp, inbytesleft, &no_read_sub, comb, + 127, 0); break; case 'E': /* ANSEL */ - x = yaz_iso5426_45_conv(inp, inbytesleft, &no_read_sub, comb, 127, 128); - break; - -#if 0 - case 'g': /* Greek */ - x = yaz_iso5426_67_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case 'b': /* Subscripts */ - x = yaz_iso5426_62_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case 'p': /* Superscripts */ - x = yaz_iso5426_70_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case '2': /* Basic Hebrew */ - x = yaz_iso5426_32_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case 'N': /* Basic Cyrillic */ - x = yaz_iso5426_4E_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); + x = yaz_iso5426_45_conv(inp, inbytesleft, &no_read_sub, comb, + 127, 128); break; - case 'Q': /* Extended Cyrillic */ - x = yaz_iso5426_51_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case '3': /* Basic Arabic */ - x = yaz_iso5426_33_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case '4': /* Extended Arabic */ - x = yaz_iso5426_34_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case 'S': /* Greek */ - x = yaz_iso5426_53_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; - case '1': /* Chinese, Japanese, Korean (EACC) */ - x = yaz_iso5426_31_conv(inp, inbytesleft, &no_read_sub, comb, 127, 0); - break; -#endif default: *no_read = 0; yaz_iconv_set_errno(cd, YAZ_ICONV_EILSEQ); diff --git a/src/odr.c b/src/odr.c index 25fafb2..d0c9288 100644 --- a/src/odr.c +++ b/src/odr.c @@ -135,15 +135,6 @@ void odr_FILE_write(ODR o, void *handle, int type, const char *buf, int len) { int i; -#if 0 - if (type == ODR_OCTETSTRING) - { - const char **stack_names = odr_get_element_path(o); - for (i = 0; stack_names[i]; i++) - fprintf((FILE*) handle, "[%s]", stack_names[i]); - fputs("\n", (FILE*) handle); - } -#endif for (i = 0; i < len; i++) { unsigned c = ((const unsigned char *) buf)[i]; diff --git a/src/siconv.c b/src/siconv.c index 596fe25..be6eae5 100644 --- a/src/siconv.c +++ b/src/siconv.c @@ -32,12 +32,6 @@ struct yaz_iconv_struct { int my_errno; int init_flag; -#if 0 - size_t (*init_handle)(yaz_iconv_t cd, unsigned char *inbuf, - size_t inbytesleft, size_t *no_read); - unsigned long (*read_handle)(yaz_iconv_t cd, unsigned char *inbuf, - size_t inbytesleft, size_t *no_read); -#endif size_t no_read_x; unsigned long unget_x; #if HAVE_ICONV_H diff --git a/src/solrtransform.c b/src/solrtransform.c index 29278ba..cdbbf13 100644 --- a/src/solrtransform.c +++ b/src/solrtransform.c @@ -307,20 +307,6 @@ solr_transform_t solr_transform_open_fname(const char *fname) return ct; } -#if 0 -struct Z_AttributeElement { - Z_AttributeSetId *attributeSet; /* OPT */ - int *attributeType; - int which; - union { - int *numeric; - Z_ComplexAttribute *complex; -#define Z_AttributeValue_numeric 1 -#define Z_AttributeValue_complex 2 - } value; -}; -#endif - static int compare_attr(Z_AttributeElement *a, Z_AttributeElement *b) { ODR odr_a = odr_createmem(ODR_ENCODE); -- 1.7.10.4