Home Bug Reports

Obj-C Mapping

slypeteslypete Member Pete SylvesterOrganization: Coconaut StudiosProject: iPhone/iPod Game ✭✭
This simple slice module:
module Datatypes
{

struct Vector2D
{
	double x;
	double y;
};

};

Produces this Obj-C method:
-(NSUInteger) hash
{
    NSUInteger h_ = 0;
    h_ = (h_ << 1) ^ x;
    h_ = (h_ << 1) ^ y;
    return h_;
}

Which yields two identical syntax errors:
error: invalid operands to binary ^

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Thanks for the bug report! We're looking into this and we'll let you know once we have a fix.

    Cheers,
    Benoit.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    I've posted a patch for this bug on this thread. Thanks again for the report!

    Cheers,
    Benoit.
  • slypeteslypete Member Pete SylvesterOrganization: Coconaut StudiosProject: iPhone/iPod Game ✭✭
    Hi Benoit,

    When I try to build IceTouch after applying the patch:
    Test.m: In function ‘-[TestOperationsStruct2 hash]’:
    Test.m:331: error: invalid operands to binary ^
    Test.m:332: error: invalid operands to binary ^
    make[4]: *** [Test.o] Error 1
    make[3]: *** [all] Error 1
    make[2]: *** [all] Error 1
    make[1]: *** [all] Error 1
    make: *** [all] Error 1
    

    I can build the same directory just fine without the patch.

    Thanks,
    Pete
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Pete,

    Sorry, I should have mentioned that rebuilding the slice2objc translator is necessary after applying the patch. To rebuild the translator:
      $ cd IceTouch-0.1.0/cpp
      $ make
    

    Note that you also need to build and install mcpp (you can use the latest version, 2.7.2) to build the translators. For instructions on how to build mcpp see the INSTALL file at the top-level of your Ice Touch distribution.

    Cheers,
    Benoit.
  • slypeteslypete Member Pete SylvesterOrganization: Coconaut StudiosProject: iPhone/iPod Game ✭✭
    Hi Benoit,

    I tried that after the entire build failed, but I had forgotten about the mcpp dependency that I read about a while back. I'm all set now!

    Thanks a lot for the quick fix,
    Pete
Sign In or Register to comment.