From 4a07e3cb30394fc8bd9c6f65ed13e61cd37d0152 Mon Sep 17 00:00:00 2001 From: sehraf Date: Wed, 1 Jun 2016 21:10:01 +0200 Subject: [PATCH 1/2] remove compiler warnings libbitdht --- libbitdht/src/bitdht/bdfilter.cc | 4 ---- libbitdht/src/bitdht/bdpeer.cc | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libbitdht/src/bitdht/bdfilter.cc b/libbitdht/src/bitdht/bdfilter.cc index 863dbba06..f536e74d8 100644 --- a/libbitdht/src/bitdht/bdfilter.cc +++ b/libbitdht/src/bitdht/bdfilter.cc @@ -46,8 +46,6 @@ bdFilter::bdFilter(const std::string &fname, const bdNodeId *ownid, uint32_t fi mFns = fns; mFilename = fname ; - time_t now = time(NULL) ; - loadBannedIpFile() ; mFilterFlags = filterFlags; @@ -92,8 +90,6 @@ void bdFilter::loadBannedIpFile() memset(&addr, 0, sizeof(struct sockaddr_in)); addr.sin_family = PF_INET; - unsigned short port; - FILE *fd = fopen(mFilename.c_str(),"r") ; if(fd == NULL) diff --git a/libbitdht/src/bitdht/bdpeer.cc b/libbitdht/src/bitdht/bdpeer.cc index 6ba86a0ff..9630fbdad 100644 --- a/libbitdht/src/bitdht/bdpeer.cc +++ b/libbitdht/src/bitdht/bdpeer.cc @@ -344,6 +344,8 @@ int bdSpace::find_node(const bdNodeId *id, int number, std::list &matchIds std::cerr << " Number: " << number; std::cerr << " Bucket #: " << buckno; std::cerr << std::endl; +#else + (void)number; #endif bdBucket &buck = buckets[buckno]; From ca90f1387d25d47082b75f255ca189a833d18879 Mon Sep 17 00:00:00 2001 From: sehraf Date: Wed, 1 Jun 2016 21:17:50 +0200 Subject: [PATCH 2/2] remove compiler warnings openpgpsdk --- openpgpsdk/src/openpgpsdk/create.c | 4 ++-- openpgpsdk/src/openpgpsdk/crypto.c | 6 ------ openpgpsdk/src/openpgpsdk/keyring.c | 2 -- openpgpsdk/src/openpgpsdk/packet-print.c | 2 +- openpgpsdk/src/openpgpsdk/util.c | 2 +- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/openpgpsdk/src/openpgpsdk/create.c b/openpgpsdk/src/openpgpsdk/create.c index befed6f6c..b4fe548a7 100644 --- a/openpgpsdk/src/openpgpsdk/create.c +++ b/openpgpsdk/src/openpgpsdk/create.c @@ -509,7 +509,7 @@ ops_boolean_t ops_write_transferable_public_key_from_packet_data(const ops_keyda ops_create_info_t *info) { ops_boolean_t rtn = ops_true; - unsigned int i=0,j=0; + unsigned int i=0; if (armoured) { ops_writer_push_armoured(info, OPS_PGP_PUBLIC_KEY_BLOCK); } @@ -532,7 +532,7 @@ ops_boolean_t ops_write_transferable_secret_key_from_packet_data(const ops_keyda ops_create_info_t *info) { ops_boolean_t rtn = ops_true; - unsigned int i=0,j=0; + unsigned int i=0; if(keydata->type != OPS_PTAG_CT_ENCRYPTED_SECRET_KEY) { diff --git a/openpgpsdk/src/openpgpsdk/crypto.c b/openpgpsdk/src/openpgpsdk/crypto.c index 7dcbd4a0a..86acebaca 100644 --- a/openpgpsdk/src/openpgpsdk/crypto.c +++ b/openpgpsdk/src/openpgpsdk/crypto.c @@ -309,11 +309,6 @@ ops_boolean_t ops_decrypt_memory(const unsigned char *encrypted_memory,int em_le const ops_boolean_t use_armour, ops_parse_cb_t* cb_get_passphrase) { - int fd_in=0; - int fd_out=0; - char* myfilename=NULL; - - // ops_parse_info_t *pinfo=NULL; // setup for reading from given input file @@ -368,7 +363,6 @@ ops_boolean_t ops_decrypt_memory(const unsigned char *encrypted_memory,int em_le *decrypted_memory = ops_mallocz(*out_length) ; memcpy(*decrypted_memory,ops_memory_get_data(output_mem),*out_length) ; -ops_decrypt_memory_ABORT: ops_teardown_memory_write(pinfo->cbinfo.cinfo, output_mem); ops_teardown_memory_read(pinfo, input_mem); diff --git a/openpgpsdk/src/openpgpsdk/keyring.c b/openpgpsdk/src/openpgpsdk/keyring.c index 5828bfa87..f210f1662 100644 --- a/openpgpsdk/src/openpgpsdk/keyring.c +++ b/openpgpsdk/src/openpgpsdk/keyring.c @@ -616,8 +616,6 @@ ops_boolean_t ops_add_selfsigned_userid_to_keydata(ops_keydata_t* keydata, ops_u ops_boolean_t ops_sign_key(ops_keydata_t* keydata, const unsigned char *signers_key_id,ops_secret_key_t *signers_key) { /* ops_memory_t* mem_userid=NULL; */ - ops_create_info_t* cinfo_userid=NULL; - ops_memory_t* mem_sig=NULL; ops_create_info_t* cinfo_sig=NULL; diff --git a/openpgpsdk/src/openpgpsdk/packet-print.c b/openpgpsdk/src/openpgpsdk/packet-print.c index 7d6fee2d3..012531aab 100644 --- a/openpgpsdk/src/openpgpsdk/packet-print.c +++ b/openpgpsdk/src/openpgpsdk/packet-print.c @@ -998,7 +998,7 @@ int ops_print_packet(const ops_parser_content_t *content_) case OPS_PTAG_SS_EMBEDDED_SIGNATURE: start_subpacket(content_->tag); - end_subpacket(content_->tag); // \todo print out contents? + end_subpacket(); // \todo print out contents? break; case OPS_PTAG_SS_USERDEFINED00: diff --git a/openpgpsdk/src/openpgpsdk/util.c b/openpgpsdk/src/openpgpsdk/util.c index 491611b8b..2dced1ff0 100644 --- a/openpgpsdk/src/openpgpsdk/util.c +++ b/openpgpsdk/src/openpgpsdk/util.c @@ -118,7 +118,7 @@ void *ops_mallocz(size_t n) void *m=malloc(n); if(m == NULL) - fprintf(stderr,"(EE) Cannot allocate %d bytes of memory in %s\n",n,__PRETTY_FUNCTION__) ; + fprintf(stderr,"(EE) Cannot allocate %lu bytes of memory in %s\n",n,__PRETTY_FUNCTION__) ; else memset(m,'\0',n);