Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fix to remove C++ compile errors. #248

Merged
merged 1 commit into from Sep 19, 2011
Merged

Conversation

artgillespie
Copy link
Contributor

A friend ran into these compiler errors tonight:

../asihttprequest/ASIDataDecompressor.m: In function 'NSData* -[ASIDataDecompressor uncompressBytes:length:error:](ASIDataDecompressor*, objc_selector*, Bytef*, NSUInteger, NSError**)':
../asihttprequest/ASIDataDecompressor.m:89: error: pointer of type 'void *' used in arithmetic
../asihttprequest/ASIDataDecompressor.m:89: error: pointer of type 'void *' used in arithmetic
../asihttprequest/ASIDataDecompressor.m:89: error: invalid conversion from 'void*' to 'Bytef*'
../asihttprequest/ASIDataDecompressor.m: In function 'BOOL +[ASIDataDecompressor uncompressDataFromFile:toFile:error:](objc_object*, objc_selector*, NSString*, NSString*, NSError**)':
../asihttprequest/ASIDataDecompressor.m:192: error: invalid conversion from 'const void*' to 'const uint8_t*'

I looked around and found a few people had the same error, but that noone had found the answer[1]. It turns out this happens if ASIDataCompressor.m is compiled with the objective-c++ flag, which can happen if the file type is set to Objective-C++ or if the project or target is set to compile all obj-c files as objective-c++.

It's a tiny change to ASIDataCompressor.m to eliminate these compiler errors: Just cast two void * returns from [NSData bytes] to Bytef * and const uint8_t *

[1] http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=ASIDataCompressor+pointer+arithmetic

pokeb added a commit that referenced this pull request Sep 19, 2011
Small fix to remove C++ compile errors.
@pokeb pokeb merged commit 0205a66 into pokeb:master Sep 19, 2011
@pokeb
Copy link
Owner

pokeb commented Sep 19, 2011

Many thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants