Changeset 52744f8 for lib


Ignore:
Timestamp:
2008-01-17T22:06:55Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
ac4adf9
Parents:
13857c6
Message:

Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts
for pid_t variables).

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/md5.c

    r13857c6 r52744f8  
    2626#include "md5.h"
    2727
    28 static void md5_transform(u_int32_t buf[4], u_int32_t const in[16]);
     28static void md5_transform(uint32_t buf[4], uint32_t const in[16]);
    2929
    3030/*
     
    5353                unsigned int len)
    5454{
    55         u_int32_t t;
     55        uint32_t t;
    5656
    5757        /* Update bitcount */
    5858
    5959        t = ctx->bits[0];
    60         if ((ctx->bits[0] = t + ((u_int32_t) len << 3)) < t)
     60        if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
    6161                ctx->bits[1]++; /* Carry from low to high */
    6262        ctx->bits[1] += len >> 29;
     
    7575                }
    7676                memcpy(p, buf, t);
    77                 md5_transform(ctx->buf, (u_int32_t *) ctx->in);
     77                md5_transform(ctx->buf, (uint32_t *) ctx->in);
    7878                buf += t;
    7979                len -= t;
     
    8383        while (len >= 64) {
    8484                memcpy(ctx->in, buf, 64);
    85                 md5_transform(ctx->buf, (u_int32_t *) ctx->in);
     85                md5_transform(ctx->buf, (uint32_t *) ctx->in);
    8686                buf += 64;
    8787                len -= 64;
     
    117117                /* Two lots of padding:  Pad the first block to 64 bytes */
    118118                memset(p, 0, count);
    119                 md5_transform(ctx->buf, (u_int32_t *) ctx->in);
     119                md5_transform(ctx->buf, (uint32_t *) ctx->in);
    120120
    121121                /* Now fill the next block with 56 bytes */
     
    127127
    128128        /* Append length in bits and transform */
    129         ((u_int32_t *) ctx->in)[14] = ctx->bits[0];
    130         ((u_int32_t *) ctx->in)[15] = ctx->bits[1];
    131 
    132         md5_transform(ctx->buf, (u_int32_t *) ctx->in);
     129        ((uint32_t *) ctx->in)[14] = ctx->bits[0];
     130        ((uint32_t *) ctx->in)[15] = ctx->bits[1];
     131
     132        md5_transform(ctx->buf, (uint32_t *) ctx->in);
    133133        memcpy(digest, ctx->buf, 16);
    134134        memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
     
    152152 * the data and converts bytes into longwords for this routine.
    153153 */
    154 static void md5_transform(u_int32_t buf[4], u_int32_t const in[16])
    155 {
    156         register u_int32_t a, b, c, d;
     154static void md5_transform(uint32_t buf[4], uint32_t const in[16])
     155{
     156        register uint32_t a, b, c, d;
    157157
    158158        a = buf[0];
  • lib/md5.h

    r13857c6 r52744f8  
    2727#include <sys/types.h>
    2828#include <gmodule.h>
     29#include <stdint.h>
    2930
    30 typedef u_int8_t md5_byte_t;
     31typedef uint8_t md5_byte_t;
    3132typedef struct MD5Context {
    32         u_int32_t buf[4];
    33         u_int32_t bits[2];
     33        uint32_t buf[4];
     34        uint32_t bits[2];
    3435        unsigned char in[64];
    3536} md5_state_t;
Note: See TracChangeset for help on using the changeset viewer.