Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C --> MPW C Message-ID: <47607@apple.Apple.COM> Date: 28 Dec 90 00:35:20 GMT References: <1990Dec24.073137.16178@cs.uoregon.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 24 In article <1990Dec24.073137.16178@cs.uoregon.edu> mkelly@cs.uoregon.edu (Michael A. Kelly) writes: >I've just finished porting a rather simple application from THINK C to >MPW C. After changing all the standard header names, the program compiled, >but it didn't work quite right. After much deliberation (and a bout with >SADE), and finally a trip through the manuals, I discovered that MPW's 'int's >are 4 bytes long (whereas THINK's are 2 bytes). There was a small section >of code that relied on the size of plain integers. After changing those ints >to shorts everything works fine. > >My question is: What other elusive differences do I have to look forward to >when porting from THINK C to MPW C ? I seem to recall that a shift right of a signed value is implementation dependent, according to ANSI. You can either shift the sign bit and fill it in with a zero or maintain the sign bit (this is the difference between using ASR versus LSR). THINK implements it one way, and MPW implements it another. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions