[esnacc-dev] [PATCH 07/11] parser: Remove the weird dependency

Aaron Conole aconole at bytheb.org
Tue Dec 6 19:47:05 UTC 2016


strings.h is for a number of unused functions, many of which are now
deprecated.  Move out of the stone-age and into the modern era; kill
strings.h

Signed-off-by: Aaron Conole <aconole at bytheb.org>
---
 c-lib/src/asn-bits.c                  | 5 +----
 compiler/back-ends/c++-gen/gen-code.c | 4 ----
 compiler/back-ends/c++-gen/kwd.c      | 5 -----
 compiler/back-ends/c-gen/kwd.c        | 5 -----
 compiler/back-ends/idl-gen/gen-code.c | 6 +-----
 compiler/back-ends/str-util.c         | 6 +-----
 compiler/core/snacc.c                 | 5 -----
 compiler/core/y.tab.y                 | 6 +-----
 doc/developer-guide-sample-app.md     | 2 +-
 9 files changed, 5 insertions(+), 39 deletions(-)

diff --git a/c-lib/src/asn-bits.c b/c-lib/src/asn-bits.c
index 457388e..6bafc08 100644
--- a/c-lib/src/asn-bits.c
+++ b/c-lib/src/asn-bits.c
@@ -17,13 +17,10 @@
  * $Header: /baseline/SNACC/c-lib/src/asn-bits.c,v 1.15 2004/03/23 18:49:21 gronej Exp $
  */
 
+#include "config.h"
 #include "asn-config.h"
 
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
 
 #include "asn-len.h"
 #include "asn-tag.h"
diff --git a/compiler/back-ends/c++-gen/gen-code.c b/compiler/back-ends/c++-gen/gen-code.c
index 37e0269..6c05ddf 100644
--- a/compiler/back-ends/c++-gen/gen-code.c
+++ b/compiler/back-ends/c++-gen/gen-code.c
@@ -34,11 +34,7 @@
 # endif
 #endif
 
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
 
 #include "asn-incl.h"
 #include "asn1module.h"
diff --git a/compiler/back-ends/c++-gen/kwd.c b/compiler/back-ends/c++-gen/kwd.c
index 79b3918..98117a2 100644
--- a/compiler/back-ends/c++-gen/kwd.c
+++ b/compiler/back-ends/c++-gen/kwd.c
@@ -54,12 +54,7 @@
 #include "config.h"
 #include "snacc.h"
 
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
-
 
 /*
  * last elmt will be NULL.
diff --git a/compiler/back-ends/c-gen/kwd.c b/compiler/back-ends/c-gen/kwd.c
index 1c10f53..40266d0 100644
--- a/compiler/back-ends/c-gen/kwd.c
+++ b/compiler/back-ends/c-gen/kwd.c
@@ -38,12 +38,7 @@
 #include "config.h"
 #include "snacc.h"
 
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
-
 
 /*
  * last elmt must be NULL.
diff --git a/compiler/back-ends/idl-gen/gen-code.c b/compiler/back-ends/idl-gen/gen-code.c
index ccf1271..cabddf0 100644
--- a/compiler/back-ends/idl-gen/gen-code.c
+++ b/compiler/back-ends/idl-gen/gen-code.c
@@ -57,14 +57,10 @@
  * first draft
  *
  */
-
+#include "config.h"
 #include "snacc.h"
 
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
 #include <time.h>
 
 #include "asn-incl.h"
diff --git a/compiler/back-ends/str-util.c b/compiler/back-ends/str-util.c
index 1e08cec..073a4f1 100644
--- a/compiler/back-ends/str-util.c
+++ b/compiler/back-ends/str-util.c
@@ -69,18 +69,14 @@
  * first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
  *
  */
-
+#include "config.h"
 #include "asn-incl.h"
 
 #include <ctype.h>
 #if HAVE_UNISTD_H
 #include <unistd.h>  /* for pathconf (..) */
 #endif
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
 #include <stdio.h>
 
 #include "asn1module.h"
diff --git a/compiler/core/snacc.c b/compiler/core/snacc.c
index a424240..cb0cba8 100644
--- a/compiler/core/snacc.c
+++ b/compiler/core/snacc.c
@@ -61,12 +61,7 @@ char *bVDAGlobalDLLExport=(char *)0;
 #include <stdarg.h>
 
 #include "asn-incl.h"
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
-
 
 #include "version.h"
 #include "mem.h"
diff --git a/compiler/core/y.tab.y b/compiler/core/y.tab.y
index 26fce55..652823e 100644
--- a/compiler/core/y.tab.y
+++ b/compiler/core/y.tab.y
@@ -27,14 +27,10 @@
 
 %{
 
+#include "config.h"
 #include "snacc.h"
 
-#if STDC_HEADERS || HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
-//#include <stdio.h>
 
 #include "asn-incl.h"
 #include "mem.h"
diff --git a/doc/developer-guide-sample-app.md b/doc/developer-guide-sample-app.md
index ea9e0c1..8e69b15 100644
--- a/doc/developer-guide-sample-app.md
+++ b/doc/developer-guide-sample-app.md
@@ -386,7 +386,7 @@ int get_multicast_socket(unsigned short port)
     }
 
     // set up addresses
-    bzero(&addr, sizeof(addr));
+    memset(&addr, 0, sizeof(addr));
     addr.sin_family = AF_INET;
     addr.sin_addr.s_addr = htonl(INADDR_ANY); 
     addr.sin_port = htons(port);
-- 
2.7.4




More information about the dev mailing list