From patchwork Thu Jul 22 20:15:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 59639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DC230B70D6 for ; Fri, 23 Jul 2010 06:18:30 +1000 (EST) Received: from localhost ([127.0.0.1]:56971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc2Ds-0002ME-3b for incoming@patchwork.ozlabs.org; Thu, 22 Jul 2010 16:18:28 -0400 Received: from [140.186.70.92] (port=51299 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc2BI-0001Pr-Mo for qemu-devel@nongnu.org; Thu, 22 Jul 2010 16:15:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oc2BH-0001MB-DR for qemu-devel@nongnu.org; Thu, 22 Jul 2010 16:15:48 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:63563) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oc2BH-0001LA-1s for qemu-devel@nongnu.org; Thu, 22 Jul 2010 16:15:47 -0400 Received: from flocke.weilnetz.de (p54ADF3D9.dip.t-dialin.net [84.173.243.217]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0Mewwv-1ON0Oz1lAv-00OkNB; Thu, 22 Jul 2010 22:15:40 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.72) (envelope-from ) id 1Oc2B9-0004qo-KS; Thu, 22 Jul 2010 22:15:39 +0200 From: Stefan Weil To: QEMU Developers Date: Thu, 22 Jul 2010 22:15:22 +0200 Message-Id: <1279829724-18604-3-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1279829724-18604-1-git-send-email-weil@mail.berlios.de> References: <1279829724-18604-1-git-send-email-weil@mail.berlios.de> X-Provags-ID: V02:K0:0NK0BLTxB3NFIpeJe7k7cTY+h3ht4nszehb0ye4Iwxd bfOhFmSCQaIJQtJABMqpnr7i4QVCeqsf4fS/ikk42jMjVJWxZg WJPdjjkhrl0WqwVa24qmSoqRoT9oNeSDbFiTJHI6OcW9nodRHk KMWchDWMOSAtApNizq++W4geAg8sLh5DK5qIJW9VpwirhXRFCy 2fxDA0qIteBEkCQGWrWm5XObJgCsTkMDxA+TkhUNJGyt9M6SfJ goHmAy6U54HBt X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH 2/4] tests: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org There is no need to have a second set of integral types. Replace them by the standard types from stdint.h. Signed-off-by: Stefan Weil --- tests/sha1.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/sha1.c b/tests/sha1.c index 3a76555..93b7c8e 100644 --- a/tests/sha1.c +++ b/tests/sha1.c @@ -23,7 +23,7 @@ A million repetitions of "a" #include #include -#include /* for u_int*_t */ +#include /* ================ sha1.h ================ */ /* @@ -33,14 +33,14 @@ By Steve Reid */ typedef struct { - u_int32_t state[5]; - u_int32_t count[2]; + uint32_t state[5]; + uint32_t count[2]; unsigned char buffer[64]; } SHA1_CTX; -void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64]); +void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); void SHA1Init(SHA1_CTX* context); -void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len); +void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len); void SHA1Final(unsigned char digest[20], SHA1_CTX* context); /* ================ end of sha1.h ================ */ #include @@ -70,12 +70,12 @@ void SHA1Final(unsigned char digest[20], SHA1_CTX* context); /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64]) +void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) { -u_int32_t a, b, c, d, e; +uint32_t a, b, c, d, e; typedef union { unsigned char c[64]; - u_int32_t l[16]; + uint32_t l[16]; } CHAR64LONG16; #ifdef SHA1HANDSOFF CHAR64LONG16 block[1]; /* use array to appear as a pointer */ @@ -145,10 +145,10 @@ void SHA1Init(SHA1_CTX* context) /* Run your data through this. */ -void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len) +void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len) { -u_int32_t i; -u_int32_t j; +uint32_t i; +uint32_t j; j = context->count[0]; if ((context->count[0] += len << 3) < j) @@ -186,7 +186,7 @@ unsigned char c; for (i = 0; i < 2; i++) { - u_int32_t t = context->count[i]; + uint32_t t = context->count[i]; int j; for (j = 0; j < 4; t >>= 8, j++)