Theocacao
Leopard
Design Element
Comment on "Open Source Objective-C Calendar Class"
by Daniel Read — Dec 28
Hi Scott,

I've gotten some warnings in the THCalendarInfo implementation file when doing a build. I hadn't changed anything in the class files. Only imported them into a basic cocoa application project.

The warnings are:
  • For all CFCalendarAddComponents calls: 'pointer targets in passing argument 4 of 'CFCalendarAddComponents' differ in signedness', and
  • For the CFCalendarComposeAbsoluteTime call: 'pointer targets in passing argument 3 of 'CFCalendarComposeAbsoluteTime' differ in signedness'.


I looked up the definition of 'signedness' on Wikipedia, which lead me to see that the fourth argument in the CFCalendarAddComponents definition is const char rather than const unsigned char, which you'd used for the format declarations. After commenting out unsigned on the relevant lines in THCalendarInfo.m the warnings for CFCalendarAddComponents calls are gone and things still work as they should.

I haven't looked at the warning for CFCalendarComposeAbsoluteTime yet but I'm wondering why I'm getting the errors as I don't imagine you would've had them when you wrote the code. I noticed the comment about the need to declare the format separately but I'm wondering why there's a disparity between your declarations for format and the definition of argument 4 in CFCalendarAddComponents.

Can you tell me more about why you used unsigned in the format declarations?
Back to "Open Source Objective-C Calendar Class"
Design Element

Copyright © Scott Stevenson 2004-2015