diff --git a/ChangeLog b/ChangeLog index 02f9bc084..09d06c2c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-12-13 Wolfgang Sourdeau + * OpenChange/MAPIStoreTypes.h (MAPIPropertyKey): renamed from + MAPIPropertyNumber, changed behaviour to only take the 2 msb into + account to generate a value key. + * OpenChange/NSData+MAPIStore.m (-asShortBinaryInMemCtx:): new corrolary method to +dataWithShortBinary:. diff --git a/OpenChange/MAPIStoreTypes.h b/OpenChange/MAPIStoreTypes.h index 04c71207a..206d8c3e4 100644 --- a/OpenChange/MAPIStoreTypes.h +++ b/OpenChange/MAPIStoreTypes.h @@ -6,7 +6,7 @@ * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) + * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This file is distributed in the hope that it will be useful, @@ -40,12 +40,12 @@ id NSObjectFromMAPISPropValue (const struct mapi_SPropValue *); id NSObjectFromStreamData (enum MAPITAGS property, NSData *streamData); static inline NSNumber * -MAPIPropertyNumber (enum MAPITAGS propTag) +MAPIPropertyKey (enum MAPITAGS propTag) { #if (GS_SIZEOF_LONG == 4) - return [NSNumber numberWithUnsignedLong: propTag]; + return [NSNumber numberWithUnsignedLong: (propTag & 0xffff0000) >> 16]; #elif (GS_SIZEOF_INT == 4) - return [NSNumber numberWithUnsignedInt: propTag]; + return [NSNumber numberWithUnsignedInt: (propTag & 0xffff0000) >> 16]; #else #error No suitable type for 4 bytes integers #endif diff --git a/OpenChange/MAPIStoreTypes.m b/OpenChange/MAPIStoreTypes.m index 41b18fddb..919f241ff 100644 --- a/OpenChange/MAPIStoreTypes.m +++ b/OpenChange/MAPIStoreTypes.m @@ -6,7 +6,7 @@ * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) + * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This file is distributed in the hope that it will be useful, @@ -122,7 +122,8 @@ NSObjectFromMAPISPropValue (const struct mapi_SPropValue *value) // #define PT_SRESTRICT 0xFD // #define PT_ACTIONS 0xFE result = [NSNull null]; - NSLog (@"object type not handled: %d (0x.4x)", valueType, valueType); + NSLog (@"%s: object type not handled: %d (0x%.4x)", + __PRETTY_FUNCTION__, valueType, valueType); } return result; @@ -181,7 +182,8 @@ NSObjectFromSPropValue (const struct SPropValue *value) // #define PT_SRESTRICT 0xFD // #define PT_ACTIONS 0xFE result = [NSNull null]; - NSLog (@"object type not handled: %d (0x.4x)", valueType, valueType); + NSLog (@"%s: object type not handled: %d (0x%.4x)", + __PRETTY_FUNCTION__, valueType, valueType); } return result; @@ -204,7 +206,8 @@ id NSObjectFromStreamData (enum MAPITAGS property, NSData* streamData) break; case PT_OBJECT: result = [NSNull null]; - NSLog (@"object type not handled: %d (0x.4x)", valueType, valueType); + NSLog (@"%s: object type not handled: %d (0x%.4x)", + __PRETTY_FUNCTION__, valueType, valueType); break; default: [NSException raise: @"MAPIStoreStreamTypeException"