• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
potential endian-related problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

potential endian-related problem?


  • Subject: potential endian-related problem?
  • From: Chase <email@hidden>
  • Date: Fri, 8 Jul 2005 05:32:16 -0500

on my ppc-mac, this code:

    int i;
    for (i = 1; i; i<<=1) {
        printf("%d\n", i);
    }


... produces the following output:

1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
4194304
8388608
16777216
33554432
67108864
134217728
268435456
536870912
1073741824
-2147483648


this, to me, looks like it's going to need an adjustment to work the same on intel.


but i don't have an intel-mac in front of me and i can't think straight enough at the moment to clearly picture what this might do on an intel machine.

can someone point out if this will indeed need to be fixed to work on intel and, if so, what change will need to be made?

basically, i just need the loop to walk the same series of numbers.

thanks.

- chase




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: potential endian-related problem?
      • From: Nicko van Someren <email@hidden>
    • Re: potential endian-related problem?
      • From: Robert Tillyard <email@hidden>
    • Re: potential endian-related problem?
      • From: Steve Bird <email@hidden>
  • Prev by Date: Re: NSTextView retainCount weirdness
  • Next by Date: Re: potential endian-related problem?
  • Previous by thread: Re: Script Editor not displaying Suite info of loadable plugins
  • Next by thread: Re: potential endian-related problem?
  • Index(es):
    • Date
    • Thread