From ea416313e9df6e4a08eb2c371ff5506409c24832 Mon Sep 17 00:00:00 2001 From: alivraghi Date: Sun, 9 Oct 2016 23:39:39 +0200 Subject: [PATCH] 1.10 Sun Apr 18 00:25:33 2010 - Done some optimizations in XS code for gcc4 ISO C90 compatibility --- Changes | 3 +++ PerlCryptLib.pm | 4 ++-- PerlCryptLib.xs | 14 ++++++++------ README | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index fa32593..59920ce 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Revision history for Perl extension PerlCryptLib ================================================ +1.10 Sun Apr 18 00:25:33 2010 + - Done some optimizations in XS code for gcc4 ISO C90 compatibility + 1.09 Sun Jul 26 04:47:10 2009 - Cryptlib header's translation has been reviewd diff --git a/PerlCryptLib.pm b/PerlCryptLib.pm index 535e1d5..f93d200 100644 --- a/PerlCryptLib.pm +++ b/PerlCryptLib.pm @@ -8,7 +8,7 @@ use Carp; require Exporter; use AutoLoader; -our $VERSION = '1.09'; +our $VERSION = '1.10'; ############################################################################# @@ -463,7 +463,7 @@ Alvaro Livraghi, =head1 COPYRIGHT AND LICENSE -Copyright (C) 2006-2009 Alvaro Livraghi. All Rights Reserved. +Copyright (C) 2006-2010 Alvaro Livraghi. All Rights Reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/PerlCryptLib.xs b/PerlCryptLib.xs index a426427..15815bc 100644 --- a/PerlCryptLib.xs +++ b/PerlCryptLib.xs @@ -20,8 +20,6 @@ MODULE = PerlCryptLib PACKAGE = PerlCryptLib -PROTOTYPES: DISABLE - INCLUDE: const-xs.inc ################################################################################ @@ -43,7 +41,8 @@ void * shift_buffer(buffer, length, offset) INIT: void * __buffer; CODE: - if ( __buffer = (void *)malloc(length) ) { + __buffer = (void *)malloc(length); + if ( __buffer != 0 ) { length -= offset; buffer += offset; memcpy(__buffer, buffer, length); @@ -509,8 +508,9 @@ int cryptDeviceQueryCapability(cryptDevice, cryptAlgo, cryptQueryInfo) const int cryptDevice; const int cryptAlgo; HV * cryptQueryInfo; - CODE: + INIT: CRYPT_QUERY_INFO dummy; + CODE: RETVAL = cryptDeviceQueryCapability(cryptDevice, cryptAlgo, &dummy); if ( RETVAL == CRYPT_OK ) { hv_store(cryptQueryInfo, "algoName", 8, newSVpv(dummy.algoName, strlen(dummy.algoName)), 0); @@ -572,8 +572,9 @@ int cryptGetCertExtension(certificate, oid, criticalFlag, extension, extensionMa int cryptQueryCapability(cryptAlgo, cryptQueryInfo) const int cryptAlgo; HV * cryptQueryInfo; - CODE: + INIT: CRYPT_QUERY_INFO dummy; + CODE: RETVAL = cryptQueryCapability(cryptAlgo, &dummy); if ( RETVAL == CRYPT_OK ) { hv_store(cryptQueryInfo, "algoName", 8, newSVpv(dummy.algoName, strlen(dummy.algoName)), 0); @@ -590,8 +591,9 @@ int cryptQueryObject(objectData, objectDataLength, cryptObjectInfo) const void * objectData; const int objectDataLength; HV * cryptObjectInfo; - CODE: + INIT: CRYPT_OBJECT_INFO dummy; + CODE: RETVAL = cryptQueryObject(objectData, objectDataLength, &dummy); if ( RETVAL == CRYPT_OK ) { hv_store(cryptObjectInfo, "objectType", 10, newSVnv(dummy.objectType), 0); diff --git a/README b/README index d37f406..596b585 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ ============================ -PerlCryptLib v.1.09 - README +PerlCryptLib v.1.10 - README ============================