]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
unsgined char -> byte
authorPavel Tvrdík <pawel.tvrdik@gmail.cz>
Tue, 19 May 2015 06:14:04 +0000 (08:14 +0200)
committerPavel Tvrdík <pawel.tvrdik@gmail.cz>
Tue, 19 May 2015 06:14:04 +0000 (08:14 +0200)
lib/md5.c
lib/md5.h
lib/printf.c
lib/sha256.c
lib/sha256.h
lib/sha512.c
lib/sha512.h
nest/route.h
proto/ospf/rt.c
sysdep/bsd/sysio.h

index f3d6e079d616a5d794e75dbda98e23becdd94d4a..75b4fd67cc0c4503a524e569bdddd2048990154e 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
 #ifdef CPU_LITTLE_ENDIAN
 #define byteReverse(buf, len)  /* Nothing */
 #else
-void byteReverse(unsigned char *buf, unsigned longs);
+void byteReverse(byte *buf, unsigned longs);
 
 /*
  * Note: this code is harmless on little-endian machines.
  */
-void byteReverse(unsigned char *buf, unsigned longs)
+void byteReverse(byte *buf, unsigned longs)
 {
   u32 t;
   do {
@@ -55,7 +55,7 @@ md5_init(md5_context *ctx)
  * of bytes.
  */
 void
-md5_update(md5_context *ctx, unsigned char const *buf, unsigned len)
+md5_update(md5_context *ctx, byte const *buf, unsigned len)
 {
   u32 t;
 
@@ -72,7 +72,7 @@ md5_update(md5_context *ctx, unsigned char const *buf, unsigned len)
 
   if (t)
   {
-    unsigned char *p = (unsigned char *) ctx->in + t;
+    byte *p = (byte *) ctx->in + t;
 
     t = 64 - t;
     if (len < t)
@@ -110,7 +110,7 @@ byte *
 md5_final(md5_context *ctx)
 {
   unsigned count;
-  unsigned char *p;
+  byte *p;
 
   /* Compute number of bytes mod 64 */
   count = (ctx->bits[0] >> 3) & 0x3F;
@@ -146,7 +146,7 @@ md5_final(md5_context *ctx)
   ((u32 *) ctx->in)[15] = ctx->bits[1];
 
   md5_transform(ctx->buf, (u32 *) ctx->in);
-  byteReverse((unsigned char *) ctx->buf, 4);
+  byteReverse((byte *) ctx->buf, 4);
 
   return (byte*) ctx->buf;
 }
index 8ace29cbd17226f23f0db91647b7f8a0e3dd61ab..78c62c78bd90cee98ea886b9d60fe236fbf9da21 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -19,11 +19,11 @@ typedef struct
 {
   u32 buf[4];
   u32 bits[2];
-  unsigned char in[64];
+  byte in[64];
 } md5_context;
 
 void md5_init(md5_context *context);
-void md5_update(md5_context *context, unsigned char const *buf, unsigned len);
+void md5_update(md5_context *context, byte const *buf, unsigned len);
 byte *md5_final(md5_context *context);
 
 void md5_transform(u32 buf[4], u32 const in[16]);
index 3eb988fa7a1fec7902b8658977552dadeada60c5..a1c3612954dd4052a94771fcea9f95a955a9b547 100644 (file)
@@ -215,7 +215,7 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args)
                        if (!(flags & LEFT))
                                while (--field_width > 0)
                                        *str++ = ' ';
-                       *str++ = (unsigned char) va_arg(args, int);
+                       *str++ = (byte) va_arg(args, int);
                        while (--field_width > 0)
                                *str++ = ' ';
                        continue;
index 4025c6a0c9ab60c7fbf76b84db3724f0115209aa..cd0fef03eb759905c2e6cb66e671c5dee481dade 100644 (file)
@@ -115,7 +115,7 @@ sum1(u32 x)
     32-bit-words. See FIPS 180-2 for details.
  */
 static unsigned int
-sha256_transform_block(sha256_context *ctx, const unsigned char *data)
+sha256_transform_block(sha256_context *ctx, const byte *data)
 {
   static const u32 K[64] = {
       0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
@@ -215,7 +215,7 @@ sha256_transform_block(sha256_context *ctx, const unsigned char *data)
 #undef R
 
 static unsigned int
-sha256_transform(void *ctx, const unsigned char *data, size_t nblks)
+sha256_transform(void *ctx, const byte *data, size_t nblks)
 {
   sha256_context *hd = ctx;
   unsigned int burn;
index 44e4a6d017854a754a4892996de7b30aac9b76b5..ce8f1460022b9cb50a684073b6c0ebab67390b60 100644 (file)
@@ -23,7 +23,7 @@
 #define SHA256_HEX_SIZE                65
 #define SHA256_BLOCK_SIZE      64
 
-typedef unsigned int sha_transform_fn (void *c, const unsigned char *blks, size_t nblks);
+typedef unsigned int sha_transform_fn (void *c, const byte *blks, size_t nblks);
 
 typedef struct {
   u32  h0,h1,h2,h3,h4,h5,h6,h7;
@@ -51,7 +51,7 @@ byte* sha224_final(sha224_context *ctx)
   return sha256_final(ctx);
 }
 
-static unsigned int sha256_transform(void *ctx, const unsigned char *data, size_t nblks);
+static unsigned int sha256_transform(void *ctx, const byte *data, size_t nblks);
 
 /**
  *     HMAC-SHA256, HMAC-SHA224
index e917eb9892f40f331862ce1cd43b471e638f140b..eea7cda80df96424972c44a8a7d325b55584d26f 100644 (file)
@@ -147,7 +147,7 @@ static const u64 k[] =
  * Transform the message W which consists of 16 64-bit-words
  */
 static unsigned int
-sha512_transform_block(sha512_state *hd, const unsigned char *data)
+sha512_transform_block(sha512_state *hd, const byte *data)
 {
   u64 a, b, c, d, e, f, g, h;
   u64 w[16];
@@ -410,7 +410,7 @@ sha512_transform_block(sha512_state *hd, const unsigned char *data)
 }
 
 static unsigned int
-sha512_transform(void *context, const unsigned char *data, size_t nblks)
+sha512_transform(void *context, const byte *data, size_t nblks)
 {
   sha512_context *ctx = context;
   unsigned int burn;
index e37bbcb6a7f9f9bcea70a5fd74cb1348023e428b..188850b47a2d70aaf49d9cfb6924bd25820134f6 100644 (file)
@@ -52,7 +52,7 @@ byte* sha384_final(sha384_context *ctx)
   return sha512_final(ctx);
 }
 
-static unsigned int sha512_transform(void *context, const unsigned char *data, size_t nblks);
+static unsigned int sha512_transform(void *context, const byte *data, size_t nblks);
 
 /**
  *     HMAC-SHA512, HMAC-SHA384
index 87f10ae3776cb32b9b24ac32cd36a0cf2db4c47c..2e6bf74110b48dd2a519d37373eb5a92056c885d 100644 (file)
@@ -320,7 +320,7 @@ struct mpnh {
   ip_addr gw;                          /* Next hop */
   struct iface *iface;                 /* Outgoing interface */
   struct mpnh *next;
-  unsigned char weight;
+  byte weight;
 };
 
 struct rte_src {
index 495178c0f8f49c4994b0037bdaabecffd6702397..e68ee0f48f216766c4d2a3f9716f13abbb83736a 100644 (file)
@@ -43,7 +43,7 @@ unresolved_vlink(ort *ort)
 }
 
 static inline struct mpnh *
-new_nexthop(struct ospf_proto *p, ip_addr gw, struct iface *iface, unsigned char weight)
+new_nexthop(struct ospf_proto *p, ip_addr gw, struct iface *iface, byte weight)
 {
   struct mpnh *nh = lp_alloc(p->nhpool, sizeof(struct mpnh));
   nh->gw = gw;
index df5e02367697998d003ed6ebda2cb694300ae277..c82d7a1e560d8c1941cd8b49a892380525866b4a 100644 (file)
@@ -130,7 +130,7 @@ static inline void
 sk_process_cmsg4_ttl(sock *s, struct cmsghdr *cm)
 {
   if (cm->cmsg_type == IP_RECVTTL)
-    s->rcv_ttl = * (unsigned char *) CMSG_DATA(cm);
+    s->rcv_ttl = * (byte *) CMSG_DATA(cm);
 }
 
 static inline void