diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-08-02 02:34:13 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-08-02 02:34:13 +0000 |
commit | 99050171cb6071ffd704c90975f0d3abc062ed8b (patch) | |
tree | 18b4ba998664d926be552b37cddce5a4e05a56e6 /wsutil | |
parent | 9bf533c9dbf3610100044e4ef9b00cd4e494523f (diff) |
Keep checkAPIs happy (even though it's just test code). Get that test code
compiling again (warning free).
Fix the checkapi target in automake.
svn path=/trunk/; revision=51114
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/Makefile.am | 3 | ||||
-rw-r--r-- | wsutil/sha1.c | 14 |
2 files changed, 10 insertions, 7 deletions
diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am index 4b35e8484f..6ccf8f2e80 100644 --- a/wsutil/Makefile.am +++ b/wsutil/Makefile.am @@ -124,7 +124,8 @@ dumpabi-libwsutil: all abi-descriptor.xml cd .libs && ln -sf libwsutil_*.abi.tar.gz libwsutil.abi.tar.gz checkapi: -# $(PERL) ../tools/checkAPIs.pl -g abort -g termoutput \ $(PERL) ../tools/checkAPIs.pl -g termoutput -build \ $(LIBWSUTIL_SRC) + +# $(PERL) ../tools/checkAPIs.pl -g abort -g termoutput \ # file_util.c unicode-utils.c diff --git a/wsutil/sha1.c b/wsutil/sha1.c index 526a2ed5d4..98ad368351 100644 --- a/wsutil/sha1.c +++ b/wsutil/sha1.c @@ -31,6 +31,7 @@ #include <glib.h> #include "sha1.h" +#include "file_util.h" #define GET_UINT32(n,b,i) \ { \ @@ -341,19 +342,20 @@ void sha1_hmac( const guint8 *key, guint32 keylen, const guint8 *buf, guint32 bu #include <stdlib.h> #include <stdio.h> #include <glib.h> +#include <errno.h> /* * those are the standard FIPS-180-1 test vectors */ -static char *msg[] = +static const char *msg[] = { "abc", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", NULL }; -static char *val[] = +static const char *val[] = { "a9993e364706816aba3e25717850c26c9cd0d89d", "84983e441c3bd26ebaae4aa1f95129e5e54670f1", @@ -381,7 +383,7 @@ int main( int argc, char *argv[] ) if( i < 2 ) { - sha1_update( &ctx, (uint8 *) msg[i], + sha1_update( &ctx, (guint8 *) msg[i], strlen( msg[i] ) ); } else @@ -390,7 +392,7 @@ int main( int argc, char *argv[] ) for( j = 0; j < 1000; j++ ) { - sha1_update( &ctx, (uint8 *) buf, 1000 ); + sha1_update( &ctx, (guint8 *) buf, 1000 ); } } @@ -414,9 +416,9 @@ int main( int argc, char *argv[] ) } else { - if( ! ( f = fopen( argv[1], "rb" ) ) ) + if( ! ( f = ws_fopen( argv[1], "rb" ) ) ) { - perror( "fopen" ); + printf("fopen: %s", g_strerror(errno)); return( 1 ); } |