[Git][NTPsec/ntpsec][master] 2 commits: Address GitLab isssue #168: pythonize-header breaks on header guards

Eric S. Raymond gitlab at mg.gitlab.com
Mon Nov 28 10:59:12 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
25009b64 by Eric S. Raymond at 2016-11-28T05:57:39-05:00
Address GitLab isssue #168: pythonize-header breaks on header guards

- - - - -
bff4324d by Eric S. Raymond at 2016-11-28T05:57:39-05:00
Address GitLab issue #167: Python3: ntpq iostats fails

- - - - -


4 changed files:

- include/ntp_control.h
- include/ntpd.h
- ntpq/ntpq
- wafhelpers/pythonize-header


Changes:

=====================================
include/ntp_control.h
=====================================
--- a/include/ntp_control.h
+++ b/include/ntp_control.h
@@ -1,6 +1,8 @@
 /*
  * ntp_control.h - definitions related to NTP mode 6 control messages
  */
+#ifndef GUARD_NTP_CONTROL_H
+#define GUARD_NTP_CONTROL_H
 
 #include "ntp_types.h"
 
@@ -158,3 +160,4 @@ struct ntp_control {
 #define	IFSTATS_FIELDS	12
 #define	RESLIST_FIELDS	4
 
+#endif /* GUARD_NTP_CONTROL_H */


=====================================
include/ntpd.h
=====================================
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -15,6 +15,7 @@
 #include "ntp_syslog.h"
 #include "ntp_malloc.h"
 #include "ntp_refclock.h"
+#include "ntp_control.h"
 #include "ntp_intres.h"
 #include "recvbuff.h"
 


=====================================
ntpq/ntpq
=====================================
--- a/ntpq/ntpq
+++ b/ntpq/ntpq
@@ -183,11 +183,11 @@ class Ntpq(cmd.Cmd):
         return line
 
     def say(self, msg):
-        sys.stdout.write(msg)
+        sys.stdout.write(polystr(msg))
         sys.stdout.flush()	# In case we're piping the output
 
     def warn(self, msg):
-        sys.stderr.write(msg)
+        sys.stderr.write(polystr(msg))
 
     def help_help(self):
         self.say("""\


=====================================
wafhelpers/pythonize-header
=====================================
--- a/wafhelpers/pythonize-header
+++ b/wafhelpers/pythonize-header
@@ -18,7 +18,7 @@ patterns = (
     (re.compile(r"^/\*"), r"#"),
     (re.compile(r"^ *\*/"), r"#"),
     (re.compile(r"^ \*"), r"#"),
-    (re.compile(r"^#define\s+([A-Z0-9_]+\s+)(.*)"), r"\1= \2"), 
+    (re.compile(r"^#define\s+([A-Z0-9_]+[ \t]+)(.*)"), r"\1= \2"), 
     (re.compile(r"^#define\s+([A-Z0-9_]+)\(([a-z_, ]*)\)"),
      r"def \1(\2): return"), 
     )



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/f360bdf5df2458f4b0c490341e24f4b48f97033b...bff4324d58bbc030c2609c7ca36cb6da03a4aa2e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161128/e2182af4/attachment.html>


More information about the vc mailing list