diff options
author | Simon Josefsson <simon@josefsson.org> | 2009-05-20 10:44:52 +0200 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2009-05-20 10:44:52 +0200 |
commit | 2f1b3d3bc5bf1164dae04b450ab99997d4ed3cc6 (patch) | |
tree | f7a398e3b27e3175991f387ce08b8eb296e48db4 | |
parent | 231d76e24fa5cc0f84e71f642573b50e99887f4f (diff) | |
download | libtasn1-2f1b3d3bc5bf1164dae04b450ab99997d4ed3cc6.tar.gz libtasn1-2f1b3d3bc5bf1164dae04b450ab99997d4ed3cc6.tar.bz2 libtasn1-2f1b3d3bc5bf1164dae04b450ab99997d4ed3cc6.zip |
Fix syntax-check problems.
-rw-r--r-- | .x-sc_prohibit_HAVE_MBRTOWC | 3 | ||||
-rw-r--r-- | .x-sc_prohibit_atoi_atof | 3 | ||||
-rw-r--r-- | .x-sc_space_tab | 3 | ||||
-rw-r--r-- | cfg.mk | 5 | ||||
-rw-r--r-- | doc/libtasn1.texi | 1 | ||||
-rw-r--r-- | doc/reference/Makefile.am | 5 | ||||
-rw-r--r-- | gtk-doc.make | 75 | ||||
-rw-r--r-- | lib/parser_aux.c | 2 | ||||
-rw-r--r-- | m4/valgrind.m4 | 8 | ||||
-rw-r--r-- | src/asn1Coding.c | 26 | ||||
-rw-r--r-- | src/asn1Decoding.c | 2 | ||||
-rw-r--r-- | src/asn1Parser.c | 32 | ||||
-rw-r--r-- | tests/pkix.asn | 24 |
13 files changed, 98 insertions, 91 deletions
diff --git a/.x-sc_prohibit_HAVE_MBRTOWC b/.x-sc_prohibit_HAVE_MBRTOWC new file mode 100644 index 0000000..31ea67c --- /dev/null +++ b/.x-sc_prohibit_HAVE_MBRTOWC @@ -0,0 +1,3 @@ +^gl/ +^lib/gllib/ +^lib/glm4/ diff --git a/.x-sc_prohibit_atoi_atof b/.x-sc_prohibit_atoi_atof new file mode 100644 index 0000000..da95a48 --- /dev/null +++ b/.x-sc_prohibit_atoi_atof @@ -0,0 +1,3 @@ +^gl/ +^src/asn1Coding.c +^src/asn1Decoding.c diff --git a/.x-sc_space_tab b/.x-sc_space_tab new file mode 100644 index 0000000..79ed1c1 --- /dev/null +++ b/.x-sc_space_tab @@ -0,0 +1,3 @@ +^doc/cyclo/ +^gl/ +^lib/ASN1.c @@ -24,6 +24,11 @@ ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile) .DEFAULT_GOAL := bootstrap endif +local-checks-to-skip = sc_prohibit_strcmp sc_prohibit_have_config_h \ + sc_require_config_h sc_require_config_h_first \ + sc_trailing_blank sc_GPL_version sc_immutable_NEWS \ + sc_copyright_check + autoreconf: test -f ./configure || autoreconf --install diff --git a/doc/libtasn1.texi b/doc/libtasn1.texi index 5a13821..c96e081 100644 --- a/doc/libtasn1.texi +++ b/doc/libtasn1.texi @@ -1,5 +1,4 @@ \input texinfo @c -*-texinfo-*- -@comment $Id$ @comment %**start of header @setfilename libtasn1.info @include version.texi diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am index ed71553..8cab924 100644 --- a/doc/reference/Makefile.am +++ b/doc/reference/Makefile.am @@ -29,7 +29,7 @@ SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS=--ignore-decorators=ASN1_API +SCAN_OPTIONS=--deprecated-guards=ASN1_DISABLE_DEPRECATED # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml @@ -58,8 +58,7 @@ EXTRA_HFILES= # Header files to ignore when scanning. Use base file name, no paths # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES=errors.h int.h parser_aux.h structure.h element.h gstr.h \ - config.h +IGNORE_HFILES=int.h parser_aux.h structure.h element.h gstr.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png diff --git a/gtk-doc.make b/gtk-doc.make index fd81fd0..6646365 100644 --- a/gtk-doc.make +++ b/gtk-doc.make @@ -5,13 +5,13 @@ #################################### if GTK_DOC_USE_LIBTOOL -GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -GTKDOC_RUN = sh -c +GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make @@ -23,7 +23,7 @@ GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) -EXTRA_DIST = \ +EXTRA_DIST = \ $(content_files) \ $(HTML_IMAGES) \ $(DOC_MAIN_SGML_FILE) \ @@ -33,8 +33,8 @@ EXTRA_DIST = \ DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp -SCANOBJ_FILES = \ - $(DOC_MODULE).args \ +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ @@ -62,9 +62,9 @@ $(REPORT_FILES): sgml-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) - cd $(srcdir) && \ + @cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) - if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ @@ -72,7 +72,7 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) test -f $$i || touch $$i ; \ done \ fi - touch scan-build.stamp + @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true @@ -82,24 +82,23 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE) tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) - cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) - touch tmpl-build.stamp + @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true -tmpl/*.sgml: +$(srcdir)/tmpl/*.sgml: @true - #### xml #### -sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) +sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) - cd $(srcdir) && \ + @cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) - touch sgml-build.stamp + @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true @@ -109,18 +108,18 @@ sgml.stamp: sgml-build.stamp html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) - rm -rf $(srcdir)/html - mkdir $(srcdir)/html - mkhtml_options=""; \ + @rm -rf $(srcdir)/html + @mkdir $(srcdir)/html + @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options=--path="$(srcdir)"; \ - fi + fi; \ cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' - cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) - touch html-build.stamp + @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp ############## @@ -137,22 +136,36 @@ maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: - -installfiles=`echo $(srcdir)/html/*`; \ + @installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ - $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo '-- Installing '$$i ; \ - $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + $(INSTALL_DATA) $$i $${installdir}; \ done; \ - which gtkdoc-rebase >/dev/null && \ - gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + mv -f $${installdir}/$(DOC_MODULE).devhelp \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi - uninstall-local: - rm -f $(DESTDIR)$(TARGET_DIR)/* + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} # # Require gtk-doc when making dist @@ -175,6 +188,6 @@ dist-hook: dist-check-gtkdoc dist-hook-local -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ cd $(distdir) && rm -f $(DISTCLEANFILES) - -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs diff --git a/lib/parser_aux.c b/lib/parser_aux.c index 554551d..98af5d6 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -1142,7 +1142,7 @@ parse_version_string (const char *s, int *major, int *minor, int *micro) * asn1_check_version - check for library version * @req_version: Required version number, or NULL. * - * Check that the the version of the library is at minimum the + * Check that the version of the library is at minimum the * requested one and return the version string; return %NULL if the * condition is not satisfied. If a %NULL is passed to this function, * no check is done, but the version string is simply returned. diff --git a/m4/valgrind.m4 b/m4/valgrind.m4 index 0cd106a..5a8006a 100644 --- a/m4/valgrind.m4 +++ b/m4/valgrind.m4 @@ -1,5 +1,5 @@ # valgrind.m4 serial 1 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -20,11 +20,11 @@ AC_DEFUN([sj_VALGRIND], else opt_valgrind_tests=no VALGRIND= - fi + fi AC_MSG_CHECKING([whether self tests are run under valgrind]) AC_ARG_ENABLE(valgrind-tests, - AS_HELP_STRING([--enable-valgrind-tests], - [run self tests under valgrind]), + AS_HELP_STRING([--enable-valgrind-tests], + [run self tests under valgrind]), opt_valgrind_tests=$enableval) AC_MSG_RESULT($opt_valgrind_tests) ]) diff --git a/src/asn1Coding.c b/src/asn1Coding.c index b084cb3..3012927 100644 --- a/src/asn1Coding.c +++ b/src/asn1Coding.c @@ -116,7 +116,7 @@ createFileName (char *inputFileName, char **outputFileName) int main (int argc, char *argv[]) { - static struct option long_options[] = { + static const struct option long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {"check", no_argument, 0, 'c'}, @@ -159,15 +159,13 @@ main (int argc, char *argv[]) case 'h': /* HELP */ printf ("%s\n", help_man); - if (outputFileName) - free (outputFileName); + free (outputFileName); exit (0); break; case 'v': /* VERSION */ version_etc (stdout, program_name, PACKAGE, VERSION, "Fabio Fiorina", NULL); - if (outputFileName) - free (outputFileName); + free (outputFileName); exit (0); break; case 'c': /* CHECK SYNTAX */ @@ -183,8 +181,7 @@ main (int argc, char *argv[]) argv[optind - 1]); printf ("%s\n", help_man); - if (outputFileName) - free (outputFileName); + free (outputFileName); exit (1); break; default: @@ -202,8 +199,7 @@ main (int argc, char *argv[]) " input file with assignments missing.\n\n"); printf ("%s\n", help_man); - if (outputFileName) - free (outputFileName); + free (outputFileName); exit (1); } @@ -213,8 +209,7 @@ main (int argc, char *argv[]) "asn1Coding: input file with assignments missing.\n\n"); printf ("%s\n", help_man); - if (outputFileName) - free (outputFileName); + free (outputFileName); exit (1); } @@ -308,8 +303,7 @@ main (int argc, char *argv[]) { printf ("asn1Coding: %s\n", errorDescription); - if (der) - free (der); + free (der); asn1_delete_structure (&definitions); asn1_delete_structure (&structure); @@ -340,8 +334,7 @@ main (int argc, char *argv[]) if (outputFile == NULL) { printf ("asn1Coding: output file '%s' not available\n", outputFileName); - if (der) - free (der); + free (der); free (inputFileAsnName); free (inputFileAssignmentName); free (outputFileName); @@ -353,8 +346,7 @@ main (int argc, char *argv[]) fclose (outputFile); printf ("\nWriting: done.\n"); - if (der) - free (der); + free (der); free (inputFileAsnName); free (inputFileAssignmentName); diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c index 8aebfc1..3fd9c67 100644 --- a/src/asn1Decoding.c +++ b/src/asn1Decoding.c @@ -57,7 +57,7 @@ static const char help_man[] = int main (int argc, char *argv[]) { - static struct option long_options[] = { + static const struct option long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {"check", no_argument, 0, 'c'}, diff --git a/src/asn1Parser.c b/src/asn1Parser.c index 7e4d18e..8a09209 100644 --- a/src/asn1Parser.c +++ b/src/asn1Parser.c @@ -59,7 +59,7 @@ static const char help_man[] = int main (int argc, char *argv[]) { - static struct option long_options[] = { + static const struct option long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {"check", no_argument, 0, 'c'}, @@ -101,19 +101,15 @@ main (int argc, char *argv[]) case 'h': /* HELP */ printf ("%s\n", help_man); - if (outputFileName) - free (outputFileName); - if (vectorName) - free (vectorName); + free (outputFileName); + free (vectorName); exit (0); break; case 'v': /* VERSION */ version_etc (stdout, program_name, PACKAGE, VERSION, "Fabio Fiorina", NULL); - if (outputFileName) - free (outputFileName); - if (vectorName) - free (vectorName); + free (outputFileName); + free (vectorName); exit (0); break; case 'c': /* CHECK SYNTAX */ @@ -133,10 +129,8 @@ main (int argc, char *argv[]) argv[optind - 1]); printf ("%s\n", help_man); - if (outputFileName) - free (outputFileName); - if (vectorName) - free (vectorName); + free (outputFileName); + free (vectorName); exit (1); break; default: @@ -152,10 +146,8 @@ main (int argc, char *argv[]) fprintf (stderr, "asn1Parser: input file name missing.\n\n"); printf ("%s\n", help_man); - if (outputFileName) - free (outputFileName); - if (vectorName) - free (vectorName); + free (outputFileName); + free (vectorName); exit (1); } else @@ -194,10 +186,8 @@ main (int argc, char *argv[]) free (inputFileName); - if (outputFileName) - free (outputFileName); - if (vectorName) - free (vectorName); + free (outputFileName); + free (vectorName); if (parse_result != ASN1_SUCCESS) exit (1); diff --git a/tests/pkix.asn b/tests/pkix.asn index d46dfa0..2883361 100644 --- a/tests/pkix.asn +++ b/tests/pkix.asn @@ -457,13 +457,13 @@ X520telephoneNumber ::= PrintableString id-at-facsimileTelephoneNumber AttributeType ::= {id-at 23} X520facsimileTelephoneNumber ::= PrintableString -id-at-pseudonym AttributeType ::= {id-at 65} +id-at-pseudonym AttributeType ::= {id-at 65} X520pseudonym ::= DirectoryString -id-at-name AttributeType ::= {id-at 41} +id-at-name AttributeType ::= {id-at 41} X520name ::= DirectoryString -id-at-streetAddress AttributeType ::= {id-at 9} +id-at-streetAddress AttributeType ::= {id-at 9} X520streetAddress ::= DirectoryString id-at-postalAddress AttributeType ::= {id-at 16} @@ -1088,9 +1088,9 @@ pkcs-5-PBKDF2-params ::= SEQUENCE { pkcs-12 OBJECT IDENTIFIER ::= {pkcs 12} pkcs-12-PFX ::= SEQUENCE { - version INTEGER {v3(3)}, - authSafe pkcs-7-ContentInfo, - macData pkcs-12-MacData OPTIONAL + version INTEGER {v3(3)}, + authSafe pkcs-7-ContentInfo, + macData pkcs-12-MacData OPTIONAL } pkcs-12-PbeParams ::= SEQUENCE { @@ -1099,7 +1099,7 @@ pkcs-12-PbeParams ::= SEQUENCE { } pkcs-12-MacData ::= SEQUENCE { - mac pkcs-7-DigestInfo, + mac pkcs-7-DigestInfo, macSalt OCTET STRING, iterations INTEGER DEFAULT 1 -- Note: The default is for historical reasons and its use is @@ -1114,9 +1114,9 @@ pkcs-12-AuthenticatedSafe ::= SEQUENCE OF pkcs-7-ContentInfo pkcs-12-SafeContents ::= SEQUENCE OF pkcs-12-SafeBag pkcs-12-SafeBag ::= SEQUENCE { - bagId OBJECT IDENTIFIER, - bagValue [0] EXPLICIT ANY DEFINED BY badId, - bagAttributes SET OF pkcs-12-PKCS12Attribute OPTIONAL + bagId OBJECT IDENTIFIER, + bagValue [0] EXPLICIT ANY DEFINED BY badId, + bagAttributes SET OF pkcs-12-PKCS12Attribute OPTIONAL } -- Bag types @@ -1146,8 +1146,8 @@ pkcs-12-CertBag ::= SEQUENCE { -- DER-encoded X.509 certificate stored in OCTET STRING pkcs-12-CRLBag ::= SEQUENCE { - crlId OBJECT IDENTIFIER, - crlValue [0] EXPLICIT ANY DEFINED BY crlId + crlId OBJECT IDENTIFIER, + crlValue [0] EXPLICIT ANY DEFINED BY crlId } -- x509CRL BAG-TYPE ::= |