Path: utzoo!attcan!uunet!ns-mx!iowasp!deimos!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!draken!d88-jwa From: d88-jwa@nada.kth.se (Jon Watte) Newsgroups: comp.sys.mac.programmer Subject: Re: dead code, brain dead lilbrary Message-ID: <2971@draken.nada.kth.se> Date: 18 Feb 90 13:05:15 GMT References: <1990Feb14.204332.24800@caen.engin.umich.edu> <20062@bellcore.bellcore.com> <10294@hoptoad.uucp> Reply-To: d88-jwa@nada.kth.se (Jon W{tte) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 20 In article <10294@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >The proper way to write atoi on the Macintosh is: >int atoi(StringPtr s) { long i; StringToNum(s, &i); return i; } ~~~ ~~~~ ~~~~~~~~ >Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com I can't believe this ! Any sane compiler would complain. If you reurn a long, the function should be declared long. If you use int, you're wide open for all kinds of incompatibilities. Int is intended only for holding "a small integer value", and you can never assume it can take a value higher than 32767. (Look in the standard) h+ -- --- Stay alert ! - Trust no one ! - Keep your laser handy ! --- h+@nada.kth.se == h+@proxxi.se == Jon Watte longer .sig available on request