]> granicus.if.org Git - git/commitdiff
sha1dc: adjust header includes for git
authorJeff King <peff@peff.net>
Thu, 16 Mar 2017 22:08:10 +0000 (18:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Mar 2017 22:16:45 +0000 (15:16 -0700)
We can replace system includes with git-compat-util.h or
cache.h (and should make sure it is included first in all C
files).  And we can drop includes from headers entirely, as
every C file should include git-compat-util.h itself.

We will add in new include guards around the header files,
though (otherwise you get into trouble including both
sha1dc/sha1.h and cache.h).

And finally, we'll use the full "sha1dc/" path for including
related files. This isn't strictly necessary, but makes the
expected resolution more obvious.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1dc/sha1.c
sha1dc/sha1.h
sha1dc/ubc_check.c
sha1dc/ubc_check.h

index 27a535c6a75779af7721966659b686ee3472858c..d25d93abd889c64cb2f05df2795edeaf63b99409 100644 (file)
@@ -5,13 +5,9 @@
 * https://opensource.org/licenses/MIT
 ***/
 
-#include <string.h>
-#include <memory.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "sha1.h"
-#include "ubc_check.h"
+#include "cache.h"
+#include "sha1dc/sha1.h"
+#include "sha1dc/ubc_check.h"
 
 
 /*
index 88556179b53012e18de6ea74ba607bf23c6187be..7d4d423b9d347cf1d9c32d28f1fc09a9c98ad01e 100644 (file)
@@ -4,13 +4,13 @@
 * See accompanying file LICENSE.txt or copy at
 * https://opensource.org/licenses/MIT
 ***/
+#ifndef SHA1DC_SHA1_H
+#define SHA1DC_SHA1_H
 
 #if defined(__cplusplus)
 extern "C" {
 #endif
 
-#include <stdint.h>
-
 /* uses SHA-1 message expansion to expand the first 16 words of W[] to 80 words */
 /* void sha1_message_expansion(uint32_t W[80]); */
 
@@ -103,3 +103,5 @@ int  SHA1DCFinal(unsigned char[20], SHA1_CTX*);
 #if defined(__cplusplus)
 }
 #endif
+
+#endif /* SHA1DC_SHA1_H */
index 27d0976daad6c4bc8da85db43df3d937cfc07102..089dd4743d8bc1c9827e5ce3ca90541d10efbb41 100644 (file)
@@ -24,8 +24,8 @@
 // ubc_check has been verified against ubc_check_verify using the 'ubc_check_test' program in the tools section
 */
 
-#include <stdint.h>
-#include "ubc_check.h"
+#include "git-compat-util.h"
+#include "sha1dc/ubc_check.h"
 
 static const uint32_t DV_I_43_0_bit    = (uint32_t)(1) << 0;
 static const uint32_t DV_I_44_0_bit    = (uint32_t)(1) << 1;
index b349bed928b5aaffae129e134f2c39f2d8259527..b64c306d77ff776acc6630bb7a855098e4ccd939 100644 (file)
@@ -27,8 +27,6 @@
 extern "C" {
 #endif
 
-#include <stdint.h>
-
 #define DVMASKSIZE 1
 typedef struct { int dvType; int dvK; int dvB; int testt; int maski; int maskb; uint32_t dm[80]; } dv_info_t;
 extern dv_info_t sha1_dvs[];