Fixed compilator warnings.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2007 14:46:12 +0000 (14:46 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2007 14:46:12 +0000 (14:46 +0000)
lib/silcasn1/silcasn1.c
lib/silcasn1/silcasn1_decode.c

index 727d61fdc37866a89bd62c1f00fb250941397d6d..5965228be1990640b2e4adf16578f2502d362f77 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2003 - 2006 Pekka Riikonen
+  Copyright (C) 2003 - 2007 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -154,13 +154,14 @@ const char *silc_asn1_tag_name(SilcAsn1Tag tag)
 #endif /* SILC_DEBUG */
 
 #ifdef SILC_DIST_TOOLKIT
+#ifdef SILC_DEBUG
 /* Dumps the ASN.1 data block into standard output (stdout). */
 
 SilcBool silc_asn1_dump(SilcAsn1 asn1, SilcBuffer src)
 {
   SilcBool ret = FALSE;
   SilcBerEncoding renc;
-  SilcAsn1Tag rtag;
+  SilcUInt32 rtag;
   const unsigned char *rdata;
   SilcUInt32 rdata_len, len = 0;
   SilcBool rindef;
@@ -169,7 +170,7 @@ SilcBool silc_asn1_dump(SilcAsn1 asn1, SilcBuffer src)
 
   while (silc_buffer_len(src)) {
     /* Decode the BER block */
-    ret = silc_ber_decode(src, NULL, &renc, (SilcUInt32 *)&rtag, &rdata,
+    ret = silc_ber_decode(src, NULL, &renc, &rtag, &rdata,
                          &rdata_len, &rindef, &len);
     if (!ret) {
       SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));
@@ -190,4 +191,5 @@ SilcBool silc_asn1_dump(SilcAsn1 asn1, SilcBuffer src)
 
   return TRUE;
 }
+#endif /* SILC_DEBUG */
 #endif /* SILC_DIST_TOOLKIT */
index ad5fe79e17ea39feef43195e6e8010a199c099d7..21c39f8cbf06335a4db2695b20c4bc560df7b25d 100644 (file)
@@ -34,8 +34,7 @@ static SilcBool silc_asn1_decoder_sof(SilcAsn1 asn1, SilcBuffer src)
   SilcList types;
   SilcAsn1Tag type;
   SilcBuffer *retb;
-  SilcUInt32 *retc;
-  SilcAsn1Tag rtag;
+  SilcUInt32 *retc, rtag;
   const unsigned char *rdata;
   SilcUInt32 rdata_len, len = 0;
   SilcBool found = FALSE, rindef;
@@ -94,7 +93,7 @@ static SilcBool silc_asn1_decoder_sof(SilcAsn1 asn1, SilcBuffer src)
   assert(type == SILC_ASN1_END);
 
   /* Decode the SEQUENCE or SET */
-  ret = silc_ber_decode(src, NULL, NULL, (SilcUInt32 *)&rtag, &rdata,
+  ret = silc_ber_decode(src, NULL, NULL, &rtag, &rdata,
                        &rdata_len, &rindef, &len);
   if (!ret) {
     SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));
@@ -108,7 +107,7 @@ static SilcBool silc_asn1_decoder_sof(SilcAsn1 asn1, SilcBuffer src)
 
   while (silc_buffer_len(src)) {
     /* Decode the BER data. */
-    ret = silc_ber_decode(src, NULL, NULL, (SilcUInt32 *)&rtag, &rdata,
+    ret = silc_ber_decode(src, NULL, NULL, &rtag, &rdata,
                          &rdata_len, &rindef, &len);
     if (!ret) {
       SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));
@@ -249,11 +248,11 @@ silc_asn1_decoder(SilcAsn1 asn1, SilcStack stack1, SilcAsn1Tag type,
                  SilcBool primitive)
 {
   unsigned char *ptr = src->data;
-  SilcAsn1Tag rtype, rtag;
+  SilcAsn1Tag rtype;
   SilcAsn1Options ropts;
   SilcBerClass rclass;
   SilcBerEncoding renc;
-  SilcUInt32 len = 0;
+  SilcUInt32 len = 0, rtag;
   SilcBool ret, indef, rindef, found = FALSE, choice = FALSE;
   const unsigned char *rdata;
   SilcUInt32 rdata_len;
@@ -317,7 +316,7 @@ silc_asn1_decoder(SilcAsn1 asn1, SilcStack stack1, SilcAsn1Tag type,
 
     /* Now decode a BER encoded block from the source buffer.  It must be
        exactly the same user is expecting. */
-    ret = silc_ber_decode(src, &rclass, &renc, (SilcUInt32 *)&rtag, &rdata,
+    ret = silc_ber_decode(src, &rclass, &renc, &rtag, &rdata,
                          &rdata_len, &rindef, &len);
     if (!ret) {
       SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));