diff --git a/Source/CXXException.m b/Source/CXXException.m index b3a4bcd11..f1239b284 100644 --- a/Source/CXXException.m +++ b/Source/CXXException.m @@ -50,7 +50,7 @@ static Class CXXExceptionClass; // TODO: Add an API for registering other classes for other exception types static Class boxClass(int64_t foo) { - if (foo == *(int64_t*)"GNUCC++\0") + if (foo == *(int64_t*)(void*)"GNUCC++\0") { return CXXExceptionClass; } @@ -75,7 +75,7 @@ static Class boxClass(int64_t foo) { char *ptr = (char*)ex; ptr -= __builtin_offsetof(struct __cxa_exception, unwindHeader); - return ((struct __cxa_exception*)ptr)->exceptionType; + return ((struct __cxa_exception*)(void*)ptr)->exceptionType; } - (void) rethrow { diff --git a/Source/GSFormat.m b/Source/GSFormat.m index dfca72803..f2f6e0f13 100644 --- a/Source/GSFormat.m +++ b/Source/GSFormat.m @@ -1685,7 +1685,7 @@ NSDictionary *locale) LABEL (form_strerror): /* Print description of error ERRNO. */ errno = save_errno; - string = (unichar *)[[[NSError _last] localizedDescription] + string = (unichar *)(void*)[[[NSError _last] localizedDescription] cStringUsingEncoding: NSUnicodeStringEncoding]; is_long = 1; /* This is a unicode string. */ goto LABEL (print_string); diff --git a/Source/GSSocketStream.m b/Source/GSSocketStream.m index 490dd4955..5ec1eac77 100644 --- a/Source/GSSocketStream.m +++ b/Source/GSSocketStream.m @@ -809,7 +809,7 @@ static NSString * const GSSOCKSAckConn = @"GSSOCKSAckConn"; #endif /* AF_INET6 */ else { - struct sockaddr_in *addr = (struct sockaddr_in*)[istream _address]; + struct sockaddr_in *addr = (struct sockaddr_in*)(void*)[istream _address]; NSDictionary *conf; NSString *host; int pnum; diff --git a/Source/GSString.m b/Source/GSString.m index 123425896..f6cbc0194 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -1840,7 +1840,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength, if (maxLength >= sizeof(unichar)) { unsigned bytes = maxLength - sizeof(unichar); - unichar *u = (unichar*)buffer; + unichar *u = (unichar*)(void*)buffer; if (GSToUnicode(&u, &bytes, self->_contents.c, self->_count, internalEncoding, NSDefaultMallocZone(), GSUniTerminate) == NO) @@ -1848,7 +1848,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength, [NSException raise: NSCharacterConversionException format: @"Can't convert to Unicode string."]; } - if (u == (unichar*)buffer) + if (u == (unichar*)(void*)buffer) { return YES; } @@ -4136,7 +4136,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException); } length /= sizeof(unichar); - if (GSUnicode((unichar*)chars, length, &isASCII, &isLatin1) != length) + if (GSUnicode((unichar*)(void*)chars, length, &isASCII, &isLatin1) != length) { if (shouldFree == YES && chars != 0) { @@ -4153,7 +4153,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException); _flags.wide = 0; while (length-- > 0) { - _contents.c[length] = ((unichar*)chars)[length]; + _contents.c[length] = ((unichar*)(void*)chars)[length]; } if (shouldFree == YES && chars != 0) { @@ -4166,7 +4166,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException); if (shouldFree == YES) { _zone = NSZoneFromPointer(chars); - _contents.u = (unichar*)chars; + _contents.u = (unichar*)(void*)chars; } else { diff --git a/Source/NSNumberFormatter.m b/Source/NSNumberFormatter.m index 2931ba2cb..f626a568b 100644 --- a/Source/NSNumberFormatter.m +++ b/Source/NSNumberFormatter.m @@ -1221,13 +1221,17 @@ static NSUInteger _defaultBehavior = 0; - (void) setRoundingIncrement: (NSNumber *) number { + switch ([number objCType][0]) + { + case 'd': + case 'f': #if GS_USE_ICU == 1 - if ([number class] == [NSDoubleNumber class]) unum_setDoubleAttribute (internal->_formatter, UNUM_ROUNDING_INCREMENT, [number doubleValue]); -#else - return; #endif + default: + return; + } } - (NSNumber *) roundingIncrement diff --git a/Source/NSPortCoder.m b/Source/NSPortCoder.m index 3fad79029..33949523d 100644 --- a/Source/NSPortCoder.m +++ b/Source/NSPortCoder.m @@ -1034,7 +1034,7 @@ static IMP _xRefImp; /* Serialize a crossref. */ #else val = GSSwapBigI128ToHost(val); #if GS_HAVE_I64 - bigval = *(uint64_t*)&val; + bigval = *(uint64_t*)(void*)&val; #else bigval = *(uint32_t*)&val; #endif diff --git a/Source/NSString.m b/Source/NSString.m index 1ae67d611..47d6d5eff 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -1265,7 +1265,7 @@ handle_printf_atsign (FILE *stream, data_bytes = [d bytes]; if ((data_bytes != NULL) && (len >= 2)) { - const unichar *data_ucs2chars = (const unichar *) data_bytes; + const unichar *data_ucs2chars = (const unichar *)(void*) data_bytes; if ((data_ucs2chars[0] == byteOrderMark) || (data_ucs2chars[0] == byteOrderMarkSwapped)) { @@ -1332,7 +1332,7 @@ handle_printf_atsign (FILE *stream, data_bytes = [d bytes]; if ((data_bytes != NULL) && (len >= 2)) { - const unichar *data_ucs2chars = (const unichar *) data_bytes; + const unichar *data_ucs2chars = (const unichar *)(void*) data_bytes; if ((data_ucs2chars[0] == byteOrderMark) || (data_ucs2chars[0] == byteOrderMarkSwapped)) { @@ -1434,7 +1434,7 @@ handle_printf_atsign (FILE *stream, data_bytes = [d bytes]; if ((data_bytes != NULL) && (len >= 2)) { - const unichar *data_ucs2chars = (const unichar *) data_bytes; + const unichar *data_ucs2chars = (const unichar *)(void*) data_bytes; if ((data_ucs2chars[0] == byteOrderMark) || (data_ucs2chars[0] == byteOrderMarkSwapped)) { @@ -1480,7 +1480,7 @@ handle_printf_atsign (FILE *stream, data_bytes = [d bytes]; if ((data_bytes != NULL) && (len >= 2)) { - const unichar *data_ucs2chars = (const unichar *) data_bytes; + const unichar *data_ucs2chars = (const unichar *)(void*) data_bytes; if ((data_ucs2chars[0] == byteOrderMark) || (data_ucs2chars[0] == byteOrderMarkSwapped)) { @@ -2931,7 +2931,7 @@ handle_printf_atsign (FILE *stream, if (maxLength > length * sizeof(unichar)) { - unichar *ptr = (unichar*)buffer; + unichar *ptr = (unichar*)(void*)buffer; maxLength = (maxLength - 1) / sizeof(unichar); [self getCharacters: ptr diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m index b67589f27..6dbc35859 100644 --- a/Source/NSTimeZone.m +++ b/Source/NSTimeZone.m @@ -2894,9 +2894,9 @@ newDetailInZoneForType(GSTimeZone *zone, TypeInfo *type) format: @"TZ_MAGIC is incorrect"]; } #endif - n_trans = GSSwapBigI32ToHost(*(int32_t*)header->tzh_timecnt); - n_types = GSSwapBigI32ToHost(*(int32_t*)header->tzh_typecnt); - charcnt = GSSwapBigI32ToHost(*(int32_t*)header->tzh_charcnt); + n_trans = GSSwapBigI32ToHost(*(int32_t*)(void*)header->tzh_timecnt); + n_types = GSSwapBigI32ToHost(*(int32_t*)(void*)header->tzh_typecnt); + charcnt = GSSwapBigI32ToHost(*(int32_t*)(void*)header->tzh_charcnt); i = pos; i += sizeof(int32_t)*n_trans;