HDTenEightyP/NetNews huggingface dataset:
From: sll2@cunixa.cc.columbia.edu (Steven L Levitt)
Newsgroups: comp.sys.mac.programmer
Subject: Bad Floating Point bug in Think C 5.0
Date: 1 Sep 92 21:29:23 GMT
Distribution: na
Organization: Columbia University

HEELLLLLLLPPPPP!

I just moved a fairly large Think C 5.0 project from a Mac II running system
6.0.4 (very old, I know) to a Mac IIci running system 7.0.1.  Both macchine
were running the same version of Think C, 5.0.2.

I have begun to encounter a problem when one of my functions returns a value
of type double (I have the Native Floating Point option on).  Typically, 
the value should be between 100 and -100, yet when the value is printed out
in a window it is always 0.0.  Now, here's the funny part.  When I use the
source-level debugger to set a breakpoint at the line where the function
returns and then step past it, the value is correct, and eventually prints
correctly on the screen.  The only difference is that a breakpoint was set, 
and the program stopped just before the function executed.

Could some wise and wonderful person enlighten me as to just what the hell is
going on here?  Does anyone know of incompatabilities Think C has with System
7 that might cause this?  Thanks in advance.


----------------
Steven L. Levitt  sll2@cunixa.cc.columbia.edu
An Undergrad
From: keith@taligent.com (Keith Rollin)
Newsgroups: comp.sys.mac.programmer
Subject: Re: ShowINIT
Date: 26 Aug 92 01:05:52 GMT
Organization: Taligent

In article <1992Aug25.225333.2882@cs.cornell.edu>, csuley@cs.cornell.edu
(Christopher Suley) writes:
> 
> I have written an extension/Control Panel and would, of course, like
> for its little icon to march along the bottom of the screen at
> startup time (user-configurable, of course!).  I know that there is
> some 'standard' code around by Paul Mercer (?) called ShowINIT that
> does this.  I snagged a copy of that out of Macintosh Programming
> Primer volume 2, and hacked it a little so that it will display an
> icl4 or icl8 icon on color screens, depending on their depth.
> However, this code seems to assume that all of a user's icons will fit
> in one row, which they don't always.
> 
> Is there a version of ShowINIT around that properly handles multiple
> rows and color icons?  If so, where can I get my grubby paws on a copy?
> 

Franois Grieu made a bunch of changes to ShowINIT a couple of years ago. From
the header:

This particular variation :
- knows how to wrap around the screen, for thoose with many inits; this only
  works with cooperating ShowINITs
- draw from  ICN#/icl4/icl8  combos, now the standard for icons; the best
  source is choosen according to main screen pixel depth and available 
  resources
- does NOT support the ToldU cicn  resources
- displays a nice empty square if no valid ICN# is present (new feature)
- has been rewritten for extreme compactness: shrinked from 964 to 500 bytes,
  while lot of error prevention and checking was added.
- is heavily commented, hopefuly compensating much of the obfuscation 
  introduced.

I think you can get it from ftp.apple.com, but I'm not sure, since I can't seem
to connect to it right now. There's also a comment in the heading of the file
that it's on AppleLink.

--
Keith Rollin
Phantom Programmer
Taligent, Inc.
Newsgroups: comp.sys.mac.programmer
From: Quinn <quinn@cs.uwa.edu.au>
Subject: Re: Formatting a disk in the background
X-Xxdate: Wed, 2 Sep 92 01: 23:22 GMT
Organization: The University of Western Australia
X-Useragent: Nuntius v1.1.1d9
Date: Wed, 2 Sep 1992 01:28:22 GMT

In article <1992Sep1.121235.11175@tc.cornell.edu> Michael G. Reed,
reed@snake.tc.cornell.edu writes:
>I don't think it can be done.  The problem is that reads/writes to
floppy 
>disks are VERY time critical.  Therefore, most OS's will disable
interupts
>and require the formatting code to run exclusively if you want a
"properly"
>formatted disk.  This happens on the mac (that's why the mouse "jumps"
when
>you are formatting disks...the mouse is interupt driven), so I don't
think 
>you're going to be able to get around it with Apple's routines...You
could
>always write your own disk I/O routines :) (just kidding).

Unless you've got a IIfx (or Quadra 900/950 ?) because the on-board
IO Processors handle all that messing around with floppies and leave
the mouse tracking smooth as silk.  [Heavy sigh]

Of course hacking the disk initialisation package to run in the
background would be fun (-;

btw Does anyone know why the disk init package doesn't display
a filler bar telling you how far it's got?  It seems like a user
interface faux pas to me.

Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
Department of Computer Science, The University of Western Australia
  -- Inquiring minds want to know where the phrase "Inquiring minds
     want to know" comes from.
Newsgroups: comp.sys.mac.programmer
From: bberqu@sagpd1 ()
Subject: Popup menus (help!!)
Keywords: popup
Date: Mon, 31 Aug 1992 17:32:44 GMT


Hi,

I have three popup menus within a dialog box and am trying to figure out
the best way to handle them, I know system 7 has support for them, but 
I would like my application to work with earlier versions of the OS also.

Here's how I'm doing it, I create the static text to the side of the 
popupmenu with ResEdit (using DITL/DLOG editor), and also the popup menus
(with the Menu editor).  Since I don't know the width of the menus in 
ResEdit to make boxes for the popupmenus to the right of the static text 
as user Items, I calculate in my program based on where the static text 
item's rect is and the width of the popup menu, the rectangle for the popupmenu.
I also create a control for the popup menu for that rectangle and store
the menuhandle in the control's refcon field.  Everything works fine up to 
this point, handling them is another story.

It seems like all I should have to do to handle popup menus is when 
ModalDialog detects an event within the dialog it should pass the 
information to my filterProc function. If I know where the event happened 
and the dialog pointer I could call FindControl which would return me the 
control, and I've previously stored the menu handle in the control refcon 
field, so then I could simply call PopMenuSelect with the controls rect 
and the menuhandle, however I don't, understand CDEFs so FindControl 
doesn't seem to be returning the control handle, also ModalDialog does not 
seem to be passing me the dialog pointer (should it be?).  I suspect 
FindControl is not finding the control because of my CDEF (it doesn't do
anything right now but return 1).  I know very little about CDEFs, IM 
doesn't seem to explain them very well (at least I don't understand them), 
I looked for information on them in bookstores over the weekend, but 
with no luck.  

Am I on the right track or totally off base.  If I'm on the right track, 
could somebody please explain CDEFs or point me to a good book on the 
subject and if ModalDialog will give me the information I need to do this.
I also don't understand how ModalDialog works either, but somebody explained 
at least how the ModalDialog and filterProc functions work together.
If I'm off base, please give me some info on how you would do it.

Thanks in advance, sorry for the long mail and hope its understandable.

Brian
Newsgroups: comp.sys.mac.programmer
From: Anders Wallgren <anders@verity.com>
Subject: Re: Open file at launch time?
Organization: Verity, Inc., Mountain View, CA, USA
Date: Thu, 3 Sep 92 22:03:03 GMT
X-Xxmessage-Id: <A6CBDA7E7601C897@pokey.verity.com>
X-Useragent: Nuntius v1.1.1d9
X-Xxdate: Thu, 3 Sep 92 23:06:38 GMT

In article <1992Sep1.225652.21499@newstand.syr.edu> J. S.
Greenfield, greeny@top.cis.syr.edu writes:
>Actually, under any normal circumstances, the finder will *either*
send
>an "oapp" or an "odoc" but *not* both.  (That is, immediately
after launching.)

Don't forget 'pdoc' - you will get either 'oapp', 'odoc', or 'pdoc'
(and sometimes 'quit' shortly thereafter), under 'normal'
conditions - this isn't enforced by anything, so be prepared for
other sequences to happen.

anders
Newsgroups: comp.sys.mac.programmer
From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
Subject: Re: out of memory in ThC 5 when dbugging
Followup-To: comp.sys.mac.programmer
Organization: Symantec Corp.
Date: Thu, 27 Aug 1992 14:31:32 GMT

In article <REEKES-240892122857@90.10.20.67> REEKES@applelink.apple.com (Jim Reekes) writes:

   Do you have WallPaper running?  It's a cdev that create desktop
   patterns, and I've found that there's a bad interaction with Think
   C that orphans memory with every step you take. :->

There is a very specific bug in the THINK C Debugger which causes an
extra ppat 0 to be orphaned on the debugger's heap after each single
step. There isn't any fix for this problem yet, but in the meantime
you should either give the debugger more memory, or switch to the
ltGray default desktop.

However, it doesn't sound like this is the problem that the original
poster is running into - if the debugger runs out of memory, you'll
get alerts like "Debugger is low on memory". Instead, he was having a
problem with launching the debugger. There's a short list of things to
try in the user manual on p. 476; most likely the partition size for
the project was too large.

When you run a project in THINK C, it uses a seperate partition for
the running project and the debugger. If you get an "out of memory"
error when launching the debugger, try making THINK C's partition
smaller. Also, bring up the Set Project Type dialog, and make sure
that the application's partition size isn't too large.

	-phil
--
   Phil Shapiro                                   Software Engineer
   Language Products Group                     Symantec Corporation
		   Internet: phils@cs.brandeis.edu
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Minimal aliases
Date: 31 Aug 92 17:43:47 +1200
Organization: University of Waikato, Hamilton, New Zealand

On page 27-19 of IM6 is the following interesting sentence:

    "GetAliasInfo cannot provide all kinds of information on a minimal alias."

In my experimentation with a set of Alias Manager externals I wrote for
HyperCard, I found out what this meant: If you create an alias with
NewAliasMinimal or NewAliasMinimalFromFullPath, then GetAliasInfo can
only return the leaf name (asiAliasName) and volume name (asiVolumeName)
(and it can probably return the zone name and server name as well, if
appropriate--haven't checked, as I don't have a network at home). What it will
*not* do is return any information for positive selector codes--asiParentName
and above.

This strikes me as a little odd, as that information must be there, for an
alias created with NewAliasMinimalFromFullPath, at least.

Also, it seems to me there is other information stored in the alias that cannot
be returned via GetAliasInfo. For example, you can't tell if the object being
aliased is supposed to be a file or a folder--not without actually resolving
the alias.

Lawrence
with an obsession about completeness.
From: Andrew Gilmartin <Andrew_Gilmartin@Brown.Edu>
Newsgroups: comp.sys.mac.programmer
Subject: Error w/ MacTCP DNR resolving cname
Date: 27 Aug 1992 14:27:51 GMT
Organization: Brown University
Distribution: world
NNTP-Posting-Host: cis_staff-kntx9.cis.brown.edu
X-UserAgent: Nuntius v1.1.1d7
X-XXMessage-ID: <A6C25F944B01B05F@cis_staff-kntx9.cis.brown.edu>
X-XXDate: Thu, 27 Aug 92 15:31:48 GMT

I am using MacTCP 1.1 and having problems resolving cnames
(host domain name aliases). The DNR code will let me resolve a
cname no more than eight times. An attempt to resolve the cname
a ninth time returns a -1 OSErr. Has anyone else had this
error? I have a work around (my own cache of resolved names),
but would like to remove this bug. Thanks.

NOTES:
OpenResolver() is called only once in the program.
Using Falkenburg's ConvertStringToAddr().
Using DTS' MacTCP interface procedures.
Using TCL 1.x w/ THINK C 5.0.2
System 7.0.1 with Tune-Up on a Macintosh IIcx.

--
Andrew Gilmartin
Computing & Information Services
Brown University

Andrew_Gilmartin@Brown.Edu
Newsgroups: comp.sys.mac.programmer
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: GNU C++ for the Macintosh?
Followup-To: comp.sys.mac.programmer
Organization: NCRPDA, Curtin University
Date: Thu, 3 Sep 1992 05:06:09 GMT

In article <cshotton-020992160619@oac2.hsc.uth.tmc.edu>,
cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton) wrote:
> 
> In article <pyknjaa.nagle@netcom.com>, nagle@netcom.com (John Nagle) wrote:
> > 
> > Glen.Stewart@f175.n2240.z1.ieee.org (Glen Stewart) writes:
> > >I see that GNU C++ supports over 40 different processors and comes with 
> > >source 
> > >code.  Is it avaiable as a running Macintosh program?
> > 
> >       GNU C++ is not available for the Macintosh for religious reasons.
> > Details in "gnu.misc.discuss".
> 
> Bzzzt. Wrong. g++ is available for MPW and can be found on ftp.apple.com.

While its true that some people in the FSF have religous objections to the
Macintosh, its also true that their very own standard license allows gcc
and most every other GNU product to be ported to the Mac.

Stan Shebs has in fact ported gcc to the Mac to run under MPW, and is
currently working on porting gcc 2.  Also, TopSoft has taken on Harvest C
development, and the intention is to combine Eric Sink's Harvest C and
Stan's port of gcc to produce a stand along C and C++ compiler.  All this
is of course a long way off, and if you are interested.  I'm not sure who
is in charge of the TopSoft effort, but you can probably get more
information by contacting Waqar <surak@ugcs.caltech.edu>.

Have fun all,
   Peter.

_______________________________________________________________________
Peter N Lewis, NCRPDA, Curtin University       peter@cujo.curtin.edu.au
GPO Box U1987, Perth WA 6001, AUSTRALIA             FAX: +61 9 367 8141
Newsgroups: comp.sys.mac.programmer
From: sdorner@qualcomm.com (Steven Dorner)
Subject: Re: Popup menus (help!!)
Followup-To: comp.sys.mac.programmer
Organization: Qualcomm, Inc
Date: Tue, 1 Sep 1992 14:40:26 GMT

haynes@mace.cc.purdue.edu (Carl W. Haynes III) wrote:
> 
>resnick@cogsci.uiuc.edu (Pete Resnick) writes:
> >
> >Suggestion 1: use the pop-up menu CDEF included with the System 6
> >Communications Toolbox for pre-System 7 machines.
> >
> 
> What's the licensing deal with this? Do we need to license the CDEF from
> Apple if we use it in our programs for pre-system 7 work?

I would assume you would have to pay the fee for redistributing the Comm
Toolbox.  This is $50 per year.  Ask sw.license@applelink.apple.com to
be sure.

It's a real shame this CDEF didn't get rolled into System 6.  The CTB
has been around since 6.0.4 or so, so it could have been done with the
release of 6.0.5 or 6.0.7.

The problem with shipping your own copy of the CDEF is that you must
renumber it, or it will interfere with the system 7 popup CDEF.  Then you
either have to use your renumbered CDEF under system 7, or you have to
change your controls on the fly to pick up the sys7 CDEF.
From: cory@enigami.mv.com (Cory Kempf)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Generic scanner API needed
Date: Thu, 27 Aug 92 23:11:51 EST
Organization: EnigamI, Inc., Nashua, NH
Reply-To: cory@enigami.mv.com
X-Mailer: uAccess - Macintosh Release: 1.6v1


In article <1992Aug27.015256.1@vax1.umkc.edu> (comp.sys.mac.programmer), tmaehl@vax1.umkc.edu writes:

>Peter: What you want is TWAIN (Toolkit Without An Important Name), an
>API to let you interface applications to all brands of scanners.

>Supposedly its will work with all types of scanners (handheld, sheet fed,
>slide scanners, etc), but while it has the backing of all the major players,
>you may not see lots of compatible hardware for a few years (so check
>with your vendor first...)

Unfortunately, the TWAIN group was more or less controlled by a need
for Windows compatability.  The result is something that probably
makes sense from a window's perspective, but considering the existance
of a de facto standard on the Mac already (Adobe Photoshop Plug In
Module), considering the lack of TWAIN compatible scanners, and applications,
considering the number of scanner manufacturers that make Photoshop
plug in modules for their scanners, and the number of applications
that support these plug in modules (including some of Adobe's competitors,
such as ColourStudio), and considering the reletive simplicity of
the PIM API vs. the complexity of the TWIAN API (a two page description
v. a rather thick manual), I really don't expect to see many TWAIN
scanners / applications on the Mac side of the fence.

+C


-------------------------------------------------------------
Cory Kempf                    EnigamI, Inc.
cory@enigami.mv.com           ...!decvax!enigami!cory
Annon:	wi.5036@wizvax.methuen.ma.us

In two years, will you be willing to admit who you voted for 
this year?  Think about it.
From: sdorner@qualcom.qualcomm.com (Steve Dorner)
Newsgroups: comp.sys.mac.programmer
Subject: Re: incrementation differences/THINK C 4.0 vs. 5.0
Date: 28 Aug 92 13:07:10 GMT
Organization: Qualcomm, Inc., San Diego, CA

mxmora@unix.SRI.COM (Matt Mora) writes:
>Steve Dorner writes:
>>	a=b=c d=e;
>I entered that line into think c and it said "syntax error" which is
>  a=b=c
>  d=e;
>then it selects the first line and say's "Missing ";" ". It knows where
>the missing ";" should go.

It does *not* know where the missing ";" should go.  It knows where
something is missing.  An '=' would be a perfectly good choice, too.

>if (a=b) {
>When the programmer really meant a==b. Should there be a option to check
>if statements?

"When the programmer really meant a==b" is the trick.  I write if
statements like your example all the time, and I mean them.

I can't use the MPW C compiler's full warnings, because all it does is
whine constantly about this particular idiom.  What I'm really looking
for is lost in reams of dreck.  If you're going to add such
warnings to a C compiler, you have to make them individually
selectable; having an "Anal Retentive" checkbox just doesn't cut it.
Finer control is necessary.  
-- 
Steve Dorner, Qualcomm, Inc.
Yes, I'm still working on Eudora and it's still free.
Newsgroups: comp.sys.mac.programmer
From: zobkiw@world.std.com (Joe Zobkiw)
Subject: AFP Anyone?
Organization: The World Public Access UNIX, Brookline, MA
Date: Sat, 29 Aug 1992 15:18:22 GMT

Hello all...

I am about to endeavour into the world of AFP Servers and the AppleTalk
Filing Protocol. I am about 50% through reading Inside AppleTalk and
the other relavent (sp?) information in IM.

Does anyone have any hints, tips, or C code that they might want to lend?
I'm just curious as to any "gotchas" that might await me. I've written
much AppleTalk code in the past but this is my first time playing with
AFP.

FYI, the application I am working on will need to create and manipulate
files and folders on the AFP Server.

Thanks in advance! :)


-- 
-------------------------------------------------------------
joe zobkiw         zobkiw@world.std.com        aol: aflzobkiw
From: mkelly@sisters.cs.uoregon.edu (Michael A. Kelly)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Top byte of 24-bit offscreen gworld?
Date: 4 Sep 92 20:17:11 GMT
Article-I.D.: cs.1992Sep4.201711.16186
Organization: University of Oregon Computer and Information Sciences Dept.

In article <1992Sep4.181047.16762@primerd.prime.com> <J.Cook@ENS.Prime.COM> writes:
>In article <28628@vedge.UUCP> brad@vedge.com (Brad Fowlow) writes:
>>Can anyone say how quickly or terribly things might
>>go awry if I try to keep some extra info in the top 8 bits
>>of the pixel data of a 24-bit offscreen gworld?
>>
>>That byte is awfully tempting as a place for alpha stuff.
>>And for the moment I'm not too concerned with how the code
>>will react under system 12; I just don't want sneaking 
>>randomness to show up next week. 
>>Have I missed something in IM6 that unequivocally rules
>>this out, or permits it?  Has anyone else been similiarly tempted?
>
>The only think I know is that you better check the spec's on your video board.
>Some video boards implement 32 bits per pixel and ignore the high 8 bits and
>some board don't have the memory there to save money.  Check your board and
>the boards of any other Macs you want to run on.

If the extra memory isn't available, the card should take care of that
itself.  Since there's no such thing as a 24-bit GWorld, those cards must
be taking the extra byte into account.

If a card does have the extra memory, and it uses that memory internally,
it should still be masking off the extra byte in a 32-bit GWorld.  If the
card has the memory but doesn't use it, it doesn't matter whether or not
it copies the extra byte.

This is all assuming you're using QuickDraw.

I haven't tested this, but it _should_ work that way.  Please correct me
if I'm wrong.

Mike.
-- 
_____________________________________________________________________________
Michael A. Kelly                                         University of Oregon
mkelly@cs.uoregon.edu                             Computer Science Department
_____________________________________________________________________________
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Comparing strings 'n stuff...
Organization: Kalamazoo College
Date: Fri, 28 Aug 1992 19:11:16 GMT

d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
>> rer@utrcv1.res.utc.com (Rick E Romkey) writes:
>
>   I am trying to compare a Str255 with a String which exists
>   in my resource file.
>
>   Boolean CompareStrings( Str255 inString )
>   {
>
>WRONG WRONG WRONG. Should say "unsigned char * inString" and
>not Str255 inString, since you're passing a reference to an
>array.

Er, much as I hate to correct the master, there's nothing wrong with an
argument of type Str255.  It resolves to:

Boolean CompareStrings(unsigned char inString[256])

...and there's nothing wrong with that.  They amount to the same thing.


While I'm wasting bandwidth, allow me to point out that converting P to
C strings and using strcmp is not only accent-unfriendly, but inefficient.
If you want 'e', 'E', and '<e-acute>' to be considered different, you
may as well write:

Boolean pstringsAreEqual(Str255 s1, Str255 s2)
{
	short len = s1[0];
	short i;
	if (s2[0] != len) return FALSE;
	for (i = 1; i <= len; ++i) {
		if (s1[i] != s2[i]) return FALSE;
	}
	return TRUE;
}
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "It's bad enough to send a rude message to another via such an anonymous
  channel [as email].  To flame someone on an open forum is, to me, the
  height of insensitivity."                                 - P.J. Plauger
From: minow@Apple.COM (Martin Minow)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Extensions to list manager
Keywords: listmanager tables matrix spreadsheet
Date: 28 Aug 92 16:49:51 GMT
Organization: Apple Computer Inc., Cupertino, CA

In article <1992Aug24.175225.413@cine88.cineca.it>
claudio@edy.elettra.trieste.it (Claudio Scafuri) writes:
>Can anyone help my find a library ( C,Pascal) to handle tables?
>I need to edit some matrixes, a spredsheet like window would be ideal.

The Think Class Library has some table classes that should suit your needs.

Martin Minow
minow@apple.com