Can´t get past compile warning when using FSPathMakeRef?

Discussion in 'Mac Programming' started by subsonix, Jan 30, 2009.

  1. subsonix macrumors 68040

    Feb 2, 2008
    So this is what I got so far.

    	UInt8 const *inFile = "drBcrash.wav";
    	FSRef outFile;
    	FSPathMakeRef(inFile, &outFile, NULL);
    The warning is generated from the first argument I think. This is the gcc warning: warning: pointer targets in initialization differ in signedness

    How could this be solved? Any ideas.
    Also, are there any easier way to assign a c-string to an FSRef?

    I have tried this, which didn´t work at all unfortunately.
    	 FSRef inFile;
    	 inFile.hidden = CFSTR("drBcrash.wav");
  2. kainjow Moderator emeritus


    Jun 15, 2000
    Probably need to cast the string:
    const UInt8 *inFile = (const UInt8 *)"drBcrash.wav";
    You can also use CFURLGetFSRef() if working with CF objects.
  3. subsonix thread starter macrumors 68040

    Feb 2, 2008
    That worked, what a releif.

    I´ll check out CFURLGetFSRef() as well.

    Thank you!

Share This Page