[Git][NTPsec/ntpsec][master] Convert tabs to spaces.

Gary E. Miller gitlab at mg.gitlab.com
Sun Sep 11 01:35:32 UTC 2016


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
ae7d2db3 by Gary E. Miller at 2016-09-10T18:34:51-07:00
Convert tabs to spaces.

The indent space is not PEP 8, but at least it runs on Python 3.

PEP 8 says indent levels s/b 4 spaces.

Somone forgot that tabs (8) is not shiftwidth (4)

- - - - -


4 changed files:

- pylib/wscript
- wafhelpers/check_structfield.py
- wafhelpers/check_type.py
- wafhelpers/probes.py


Changes:

=====================================
pylib/wscript
=====================================
--- a/pylib/wscript
+++ b/pylib/wscript
@@ -1,9 +1,9 @@
 def options(opt):
-        opt.load('python')
+    opt.load('python')
 
 def configure(conf):
-        conf.load('python')
-	conf.check_python_version((2,6,0))
+    conf.load('python')
+    conf.check_python_version((2,6,0))
 
 def build(bld):
-	bld(features='py', source=bld.path.ant_glob('*.py'), install_from='.',install_path='${PYTHONDIR}/ntp')
+    bld(features='py', source=bld.path.ant_glob('*.py'), install_from='.',install_path='${PYTHONDIR}/ntp')


=====================================
wafhelpers/check_structfield.py
=====================================
--- a/wafhelpers/check_structfield.py
+++ b/wafhelpers/check_structfield.py
@@ -5,24 +5,24 @@ TYPE_FRAG = """
 #include <sys/types.h>
 %s
 int main () {
-	struct %s x;
-	if (sizeof (x.%s))
-		return 0;
-	return 0;
+        struct %s x;
+        if (sizeof (x.%s))
+                return 0;
+        return 0;
 }
 """
 
 @conf
 def check_structfield(ctx, fld, type, hdrs, mandatory=False):
-	name = "STRUCT_%s_HAS_%s" % (type.upper(), fld.upper().replace('.','_'))
-	src = ""
+        name = "STRUCT_%s_HAS_%s" % (type.upper(), fld.upper().replace('.','_'))
+        src = ""
         for hdr in hdrs:
-		src += "#include <%s>\n" % hdr
-	ctx.check_cc(
-		fragment    = TYPE_FRAG % (src, type, fld),
-		define_name = name,
-		execute     = False,
-		msg         = "Checking for %s in struct %s" % (fld, type),
-		mandatory   = mandatory,
-		comment		= "Whether struct '%s' has field '%s'" % (fld, type)
-	)
+                src += "#include <%s>\n" % hdr
+        ctx.check_cc(
+                fragment    = TYPE_FRAG % (src, type, fld),
+                define_name = name,
+                execute     = False,
+                msg         = "Checking for %s in struct %s" % (fld, type),
+                mandatory   = mandatory,
+                comment         = "Whether struct '%s' has field '%s'" % (fld, type)
+        )


=====================================
wafhelpers/check_type.py
=====================================
--- a/wafhelpers/check_type.py
+++ b/wafhelpers/check_type.py
@@ -2,24 +2,24 @@ from waflib.Configure import conf
 
 TYPE_FRAG = """
 int main () {
-	if (sizeof (%s))
-		return 0;
-	return 0;
+        if (sizeof (%s))
+                return 0;
+        return 0;
 }
 """
 
 @conf
 def check_type(ctx, typename, headers=[], mandatory=False):
-	import os
-	name = "HAVE_%s" % typename.upper().replace(" ", "_")
-	src = ""
+        import os
+        name = "HAVE_%s" % typename.upper().replace(" ", "_")
+        src = ""
         for hdr in headers:
-		src += "#include <%s>\n" % hdr
-	ctx.check_cc(
-		fragment	= src + TYPE_FRAG % (typename),
-		define_name = name,
-		execute     = False,
-		msg         = "Checking for type %s" % (typename),
-		mandatory	= mandatory,
-		comment		= "Whether type '%s' exists." % typename
-	)
+                src += "#include <%s>\n" % hdr
+        ctx.check_cc(
+                fragment        = src + TYPE_FRAG % (typename),
+                define_name = name,
+                execute     = False,
+                msg         = "Checking for type %s" % (typename),
+                mandatory       = mandatory,
+                comment         = "Whether type '%s' exists." % typename
+        )


=====================================
wafhelpers/probes.py
=====================================
--- a/wafhelpers/probes.py
+++ b/wafhelpers/probes.py
@@ -4,56 +4,56 @@ up the logic in the main configure.py.
 """
 
 def probe_header_with_prerequisites(ctx, header, prerequisites, use=None):
-	"Check that a header (with its prerequisites) compiles."
-	src = ""
+        "Check that a header (with its prerequisites) compiles."
+        src = ""
         for hdr in prerequisites + [header]:
-        	src += "#include <%s>\n" % hdr
+                src += "#include <%s>\n" % hdr
         src += "int main() { return 0; }\n"
-	have_name = "HAVE_%s" % header.replace(".","_").replace("/","_").upper()
-	ctx.check_cc(
-		fragment=src,
-		define_name=have_name,
-		msg = "Checking for header %s" % header,
-		use = use or [],
-		mandatory = False,
-		comment = "<%s> header" % header)
-	return ctx.get_define(have_name)
+        have_name = "HAVE_%s" % header.replace(".","_").replace("/","_").upper()
+        ctx.check_cc(
+                fragment=src,
+                define_name=have_name,
+                msg = "Checking for header %s" % header,
+                use = use or [],
+                mandatory = False,
+                comment = "<%s> header" % header)
+        return ctx.get_define(have_name)
 
 def probe_function_with_prerequisites(ctx, function, prerequisites, use=None):
-	"Check that a function (with its prerequisites) compiles."
-	src = ""
+        "Check that a function (with its prerequisites) compiles."
+        src = ""
         for hdr in prerequisites:
-        	src += "#include <%s>\n" % hdr
+                src += "#include <%s>\n" % hdr
         src += """int main() {
-	void *p = (void*)(%s);
-	return (int)p;
+        void *p = (void*)(%s);
+        return (int)p;
 }
 """ % function
-	have_name = "HAVE_%s" % function.upper()
-	ctx.check_cc(
-		fragment=src,
-		define_name=have_name,
-		msg = "Checking for function %s" % function,
-		use = use or [],
-		mandatory = False,
-		comment = "Whether %s() exists" % function)
-	return ctx.get_define(have_name)
+        have_name = "HAVE_%s" % function.upper()
+        ctx.check_cc(
+                fragment=src,
+                define_name=have_name,
+                msg = "Checking for function %s" % function,
+                use = use or [],
+                mandatory = False,
+                comment = "Whether %s() exists" % function)
+        return ctx.get_define(have_name)
 
 def probe_multicast(ctx, symbol, legend):
-	"Probe for IP multicast capability."
-	ctx.check_cc(
-		fragment="""
+        "Probe for IP multicast capability."
+        ctx.check_cc(
+                fragment="""
 #include <netinet/in.h>
 int main() {
-	struct ip_mreq ipmr;
-	ipmr.imr_interface.s_addr = 0;
-	return 0;
+        struct ip_mreq ipmr;
+        ipmr.imr_interface.s_addr = 0;
+        return 0;
 }
 """,
-		define_name=symbol,
-		msg = legend,
-		mandatory = False,
-		comment = "IP multicast capability")
+                define_name=symbol,
+                msg = legend,
+                mandatory = False,
+                comment = "IP multicast capability")
 
 # What we really want to do here is test to see if the following program
 # compiles *and exits with 9 status*.  Because we don't know how to check
@@ -66,35 +66,35 @@ int main() {
 
 int call_vsnprintf(char *dst, size_t sz, const char *fmt,...)
 {
-	va_list	ap;
-	int		rc;
+        va_list ap;
+        int             rc;
 
-	va_start(ap, fmt);
-	rc = vsnprintf(dst, sz, fmt, ap);
-	va_end(ap);
+        va_start(ap, fmt);
+        rc = vsnprintf(dst, sz, fmt, ap);
+        va_end(ap);
 
-	return rc;
+        return rc;
 }
 
 int main()
 {
-	char	sbuf[512];
-	char	pbuf[512];
-	int		slen;
+        char    sbuf[512];
+        char    pbuf[512];
+        int             slen;
 
-	strcpy(sbuf, strerror(ENOENT));
-	errno = ENOENT;
-	slen = call_vsnprintf(pbuf, sizeof(pbuf), "%m",
-			  "wrong");
-	return strcmp(sbuf, pbuf);
+        strcpy(sbuf, strerror(ENOENT));
+        errno = ENOENT;
+        slen = call_vsnprintf(pbuf, sizeof(pbuf), "%m",
+                          "wrong");
+        return strcmp(sbuf, pbuf);
 }
 '''
 
 
 def probe_vsprintfm(ctx, symbol, legend):
-	"Probe for %m expanding to strerror(error) in glibc style."
-	ctx.check_cc(
-		fragment='''
+        "Probe for %m expanding to strerror(error) in glibc style."
+        ctx.check_cc(
+                fragment='''
 #include <features.h>
 int main()
 {
@@ -103,7 +103,7 @@ int main()
 #endif
 }
 ''',
-		define_name=symbol,
-		msg = legend,
-		mandatory = False,
-		comment="%m expanding to strerror(error) in glibc style")
+                define_name=symbol,
+                msg = legend,
+                mandatory = False,
+                comment="%m expanding to strerror(error) in glibc style")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ae7d2db3eadca01307200f7bb827b79b8398bf25
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160911/d00a9646/attachment.html>


More information about the vc mailing list