[Pkg-wmaker-commits] [wmbiff] 04/17: include file reordering, based on wisdom from porting some other networky code

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:04:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to tag wmbiff_0_4_18
in repository wmbiff.

commit e96492c28bd7da61dabb4c38962c698f7a64f177
Author: bluehal <bluehal>
Date:   Sun Oct 26 07:42:28 2003 +0000

    include file reordering, based on wisdom from porting some other networky code
---
 check-includes.rb      | 43 +++++++++++++++++++++++++++++++++++++++++--
 wmbiff/maildirClient.c |  5 +++--
 wmbiff/socket.c        |  4 ++--
 3 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/check-includes.rb b/check-includes.rb
index 466d0f3..004d46d 100755
--- a/check-includes.rb
+++ b/check-includes.rb
@@ -10,12 +10,12 @@ FILES = 'wmgeneral/*.[ch] wmbiff/*.[ch]'
 
 def include_a_before_b(first, second) 
     typeincl = Hash.new(9000)
-    IO.popen("egrep -n \"#{first}[>.]\" " + FILES, 'r').readlines.each { |l|
+    IO.popen('egrep -n "include *[<\"]' + first + '[>.]" ' + FILES, 'r').readlines.each { |l|
         file,line,text = l.split(':');
         typeincl[file] = line;
     }
     
-    IO.popen("grep -n \"#{second}[>.]\" " + FILES, 'r').readlines.each { |l|
+    IO.popen('grep -n "include *[<\"]' + second + '[>.]" ' + FILES, 'r').readlines.each { |l|
         file,line,text = l.split(':');
         if(typeincl[file].to_i > line.to_i) then
             $failed = 1;
@@ -28,11 +28,50 @@ def include_a_before_b(first, second)
     }
 end
 
+def unportable_function(fn)
+  typeincl = Hash.new(9000)
+  IO.popen("egrep -n \"#{fn} *\\(\" " + FILES, 'r').readlines.each { |l|
+    file,line,text = l.split(':');
+    typeincl[file] = line;
+    $failed = 1
+  }
+  typeincl.each { |f,l| 
+    puts "#{f}:#{l} references unportable function #{fn}"
+  }
+end
+
+def unportable_constant(cn)
+  typeincl = Hash.new(9000)
+  IO.popen("egrep -n #{cn} " + FILES, 'r').readlines.each { |l|
+    file,line,text = l.split(':');
+    typeincl[file] = line;
+    $failed = 1
+  }
+  typeincl.each { |f,l| 
+    puts "#{f}:#{l} references unportable constant #{cn}"
+  }
+end
+  
+
 include_a_before_b("sys/types", "sys/socket") 
+include_a_before_b("sys/types", "fcntl") 
+include_a_before_b("sys/types", "dirent") # mac
+include_a_before_b("sys/types", "netinet/in") # mac
 include_a_before_b("sys/types", "netinet/in_systm") 
 include_a_before_b("netinet/in_systm", "netinet/ip") 
 include_a_before_b("netinet/in", "netinet/ip") 
+include_a_before_b("netinet/in", "netinet/if_ether") # bsd
+include_a_before_b("sys/socket", "netinet/if_ether") # bsd
+include_a_before_b("sys/types", "netinet/if_ether") # bsd
 include_a_before_b("sys/types", "sys/resource")  # not sure if there's more 
 include_a_before_b("sys/time", "sys/resource")   # order here.
+# also, nscommon should follow system header files like dirent, stdlib.
+
+unportable_function("bcopy"); # not present on solaris
+unportable_function("bzero"); # would rather just use memcpy, memset
+unportable_function("asprintf"); # easy enough to malloc(strlen())
+unportable_constant("ICMP_TIMESTAMP"); # use TSTAMP instead.
+unportable_constant("uint64_t"); # use u_int64_t instead.
+unportable_constant("uint32_t"); # use u_int32_t instead.
 
 Kernel.exit($failed)
diff --git a/wmbiff/maildirClient.c b/wmbiff/maildirClient.c
index 276310b..411f7bd 100644
--- a/wmbiff/maildirClient.c
+++ b/wmbiff/maildirClient.c
@@ -1,11 +1,11 @@
-/* $Id: maildirClient.c,v 1.12 2002/10/14 05:52:26 bluehal Exp $ */
+/* $Id: maildirClient.c,v 1.13 2003/10/26 07:42:28 bluehal Exp $ */
 /* Author : Yong-iL Joh ( tolkien at mizi.com )
    Modified : Jorge Garc�a ( Jorge.Garcia at uv.es )
    Modified : Dwayne C. Litzenberger ( dlitz at dlitz.net )
  * 
  * Maildir checker.
  *
- * Last Updated : $Date: 2002/10/14 05:52:26 $
+ * Last Updated : $Date: 2003/10/26 07:42:28 $
  *
  */
 
@@ -15,6 +15,7 @@
 
 #include "Client.h"
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <dirent.h>
 #include <errno.h>
 #include <utime.h>
diff --git a/wmbiff/socket.c b/wmbiff/socket.c
index 3748466..7813e06 100644
--- a/wmbiff/socket.c
+++ b/wmbiff/socket.c
@@ -1,4 +1,4 @@
-/* $Id: socket.c,v 1.9 2003/07/03 05:34:22 bluehal Exp $ */
+/* $Id: socket.c,v 1.10 2003/10/26 07:42:29 bluehal Exp $ */
 /* Copyright (C) 1998 Trent Piepho  <xyzzy at u.washington.edu>
  *           (C) 1999 Trent Piepho  <xyzzy at speakeasy.org>
  *
@@ -19,8 +19,8 @@
 #endif
 #include <stdio.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/types.h>
+#include <fcntl.h>
 #include <time.h>
 #include <sys/stat.h>
 #include <sys/socket.h>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list