HDTenEightyP/NetNews huggingface dataset:
From: rittle@hew2.cs.uiuc.edu (Loren Rittle)
Subject: Re: limit to malloc() allocation size?
Followup-To: comp.lang.stdc
Organization: University of Illinois at Urbana-Champaign
Date: Thu, 16 Apr 1992 13:34:29 GMT

Original question:
>Is there a maximum size which the malloc() family (malloc(), calloc(), etc.
>can allocate?

bevis@en.ecn.purdue.edu (Jeff Bevis) then wrote:
>I believe that the ANSI C specification requires that you limit yourself
>to no more than 64K length allocs at once.  (don't quote me, please)

I replied:
>This is incorrect.  malloc() and friends can allocate upto <max. number
>that fits in a variable with type size_t> bytes.

Finally, bevis@en.ecn.purdue.edu (Jeff Bevis) replied to my reply:
>I do *not* believe so.  Note that I said you *should* not allocate more 
>than 64K blocks, as per ANSI definition.  This is for the purpose of 

But the C Standard doesn't say one way or another whether one should
or shouldn't try to allocate memory in pieces larger than a given
size.  The C Standard only says (what I said above) that malloc()
and friends can allocate upto <max. number that fits in a variable with
type size_t> bytes.  Do you disagree with that (You said, ``I do *not*
believe so.'' in response before)?

I own and read a copy of the standard.  [I honestly don't
want to make this personal, but a valid question would be: Do you?]

>maintaining portability of code... Each system is only required to allow at 
>least 64K malloc's in one gulp to meet spec.  I did *not* say that you
>couldn't allocate more ... in fact, you most certainly can.  It's just
>not as portable, or proper.  size_t gives you info on your specific system's
>limits, so you can go further with confidence...

The point I'm trying to make is that the Standard doesn't set this
limit that you seem quick to want to set (and in fact seem sure is there).

It is up to me the C coder to decide what size size_t is needed
to allow my code to be portable (not the standard).  I could write
code that requires a minimum sizeof (size_t) of *8* and I could
still be writing portable C code as per the C Standard (ANSI and ISO
standards).

>I think it was.  Why would ANSI approve their definition of C if MS-DROSS
>machines operating with 64K segmented memory wouldn't be able to grant
>you more than 64K of continuous memory in some cases?  I suspect that is
>how the magic number "64K" was chosen.

But there is no magic number "64K".  Go read the standard or ask in
comp.lang.stdc.  Since this topic of marginal use to this newsgroup's
charter, let's take this to email or go to the correct newsgroup.

Regards,
Loren
From: bkirk@iesd.auc.dk (Brian Kirkegaard)
Newsgroups: comp.sys.amiga.programmer
Subject: C-routines in M2Amiga ?
Date: 9 Apr 92 16:25:10 GMT
Distribution: comp.sys.amiga.programmer
Organization: Mathematics and Computer Science, Aalborg University

Has anyone tried to use C-routines in M2Amiga ???

It seems to be possible, but I don't know how to do it.
Can somebody tell me if it is at all possible, and if so
how to do it ?

Thanks,
	Brian

--
Brian Kirkegaard
Department of Mathematics & Computer Science,
Aalborg University (AUC)
E-mail: bkirk@iesd.auc.dk
From: tgaloppo@pdrome.UUCP (Travis Galoppo)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: Turbo Pascal
Date: 15 Apr 92 16:06:57 GMT
Organization: The PowerDrome BBS [(716)825-3614 CNet]


N{
/
B'?o
ahafadaba`a^a\aZaXaVaaaPaNaLaJaHaFaDaBa@

*----------------------------------------------------------------------------*
| Email To:  Travis Galoppo                    Above statements are mine, not:
| aquarium!pdrome!tgaloppo@acsu.buffalo.edu    those of PowerDrome..         |
*---------------Quote: When in doubt, throw it out!--------------------------*
Newsgroups: comp.sys.amiga.programmer
From: schaem@sgi.com (greg schaem)
Subject: Re: Need help - Simple use of blitter with assembly
Organization: Silicon Graphics, Inc.
Date: Tue, 14 Apr 1992 21:20:06 GMT

 You need A+C+D minterm $E2..

If you run on a 020+ have 32 copy of the circle
(Pre shifted) and AND/OR .

 Than
	or.l	(Disc)+,(background)
	adda.l	Modulo,backgound

repeat 30 times

 and 1 more routine using and.

If your disk are bigger than 32, it get complicated.

Have fun.

						Stephan.

Newsgroups: comp.sys.amiga.programmer
From: DURHAM@ricevm1.rice.edu (Mark A. Durham)
Subject: Re: free -- how it works
Organization: Rice University, Houston, TX
Date: Mon, 13 Apr 1992 20:32:24 GMT

In article <920413.012528.CDT.C503719@UMCVMB.MISSOURI.EDU>
C503719@UMCVMB.MISSOURI.EDU (Baird McIntosh) writes:

>Now, the question.  If the free(*p) statement is commented out, the
>program still seems to free all memory that it mallocs.  That is, after
>running the program several times, 'avail' still shows the same amount
>of memory before running as after.  Why?  If we don't free(*p), there should
>be 1000 ints * 4 bytes/int == 4000 bytes eaten each time the program runs.
>Or do I misunderstand how the free() function works?  (That's probably it :-)

I can not speak to DICE or free() in general, but in SAS/C any malloc()ed
memory not explicity free()ed by your program is restored to the system
when you call exit(0).

If you want to see the effects of free()ing memory, put in a pause prompt
after allocating the memory and after free()ing the memory and look at
the system's free memory at each pause.
From: navas@cory.Berkeley.EDU (David C. Navas)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: Input handler for Games (was Re: Custom Copperlist)
Date: 16 Apr 92 17:19:20 GMT
Distribution: usa
Organization: University of California, at Berkeley
NNTP-Posting-Host: cory.berkeley.edu

In article <1992Apr15.201619.5534@samba.oit.unc.edu> utoddl@next1.oit.unc.edu (Todd M. Lewis) writes:
>The Game need not
>even be a game--it could be your own Intuition replacement.  (Ha!)

Don't bloody well tempt me.
(Or if you do, offer monetary compensation :))

David Navas                                   navas@cory.berkeley.edu
"TWA: if you're not terrorists BEFORE you board...."
From: griffin@frith.msu.edu (Danny Griffin)
Newsgroups: comp.sys.amiga.programmer
Subject: Intuition - Menus under 2.04
Date: 13 Apr 92 02:04:14 GMT
Organization: Michigan State University, College of Engineering, East Lansing
Originator: griffin@frith.egr.msu.edu

I have written a program that does not respond to menu hotkeys
(i.e. RAmiga-Q) unless the window is first clicked in or otherwise
used.  The window does come up active, but typing a menu shortcut
results in the screen flashing.  Once the window is clicked in,
then all the menus work as they are supposed to.  I have put an
fprintf statement my event-loop and it appears that there is NO
signal being generated.  Here is a fragment:

Wait(1L<<win->UserPort->mp_SigBit);
.  
. [decoding done here]
.
fprintf(stderr, "class = %ld code = %d qualifier = %d\n",class,code,qualifier);

The program never gets past the Wait() when hotkeys are used immediately.
Mouse selection of the menu works fine initially, though.  Does anyone
have any clues as to what could be wrong?

I'm using WB2.04 and Manx Aztec C 5.2a on an A2000/2630.

-- 
Dan Griffin                          Advanced Business Systems, Inc.       
griffin@frith.egr.msu.edu            Medical and Dental Practice Management
517/349-0386                         517/349-8057
From: ronald@ecl014.UUCP (Ronald van Eijck)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: Custom Copperlist
Date: 8 Apr 92 17:11:40 GMT
Organization: R&R Software

In article <1992Apr6.143233.23632@cccan.uucp> entity@cccan.uucp (Cybernetworx) writes:
>
>Is there a system friendly way of doing the following:  I'd like a custom
>copperlist for a certain application.  I'd like to get IDCMP port to the
>screen, but since I don't need a window, I'd rather not waste memory on one.

>    \\\ ///               UUCP:   ...uunet!utai!lsuc!becker!cccan!entity
> CYBERNETWORX             INET:   entity@cccan.gts.org

You don't have to waste memory. If you open a (full size) window on the
screen and it is not obscured by another window you don't loose much
memory on it (only the window structure, no CHIP mem). If you use
SIMPLE_REFRESH windows you won't even loose memory when the windows do overlap
but you have to redraw damaged parts yourself. Take a good look at the
RKM Libraries (yes until 15-xxx-xx you have to use the 1.3 version ;-)

C'ya,

--
  +-------------------------------------------------------------------------+
  |  Ronald van Eijck                                         R&R Software  |
  |                                                                         |
  |      You move slowly, but surely, to success.  (my fortune cookie)      |
  +-------------------------------------------------------------------------+
Newsgroups: comp.sys.amiga.programmer
From: danb@gaff.physci.psu.edu (Dan Babcock)
Subject: Re: Help with devices
Organization: Penn State University, Physical Sciences
Date: Mon, 6 Apr 1992 15:59:00 GMT

In article <70VsiB4w164w@lakes.trenton.sc.us> rock@lakes.trenton.sc.us (Rockerboy) writes:
>I am trying to learn proper usage of the various devices, and yes, I have 
>the RKM's, but I just don't understand what they're telling me.  In the 
>68K include files, I see a lot of statements I have no idea what they do. 
> For example, in exec/io.i, the io request structure is defined like 
>this:
>
>STRUCTURE   IO,MN_SIZE
>    APTR    IO_DEVICE
>    APTR    IO_UNIT
>    UWORD   IO_COMMAND
>    UBYTE   IO_FLAGS
>    BYTE    IO_ERROR
>    LABEL   IO_SIZE

This is equivilent to:
IO equ 0
IO_DEVICE equ MN_SIZE
IO_UNIT equ MN_SIZE+4
IO_COMMAND equ MN_SIZE+8
IO_FLAGS equ MN_SIZE+10
IO_ERROR equ MN_SIZE+11
IO_SIZE equ MN_SIZE+12

Get the idea? APTR/LONG=4 bytes, UWORD/WORD=2 bytes, UBYTE/BYTE=1 byte.
You use the equates in code like this:

	move.w	#CMD_READ,IO_COMMAND(a1)
	...

Dan
From: pat_meloy@outbound.wimsey.bc.ca (Pat Meloy)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: Intuition - Menus under 2.04
Distribution: world
X-NewsSoftware: Amiga GRn V1.28 2/25/92 (Beta) by Mike Schwartz
Date: 13 Apr 92 01:24:50 PST

In article <1992Apr13.020414.15611@msuinfo.cl.msu.edu> griffin@frith.msu.edu (Danny Griffin) writes:
>I have written a program that does not respond to menu hotkeys
>(i.e. RAmiga-Q) unless the window is first clicked in or otherwise
>used.  The window does come up active, but typing a menu shortcut
>results in the screen flashing.  Once the window is clicked in,
>then all the menus work as they are supposed to.  I have put an
>fprintf statement my event-loop and it appears that there is NO
>signal being generated.  Here is a fragment:
>
>Wait(1L<<win->UserPort->mp_SigBit);
>.  
>. [decoding done here]
>.
>fprintf(stderr, "class = %ld code = %d qualifier = %d\n",class,code,qualifier);
>
>The program never gets past the Wait() when hotkeys are used immediately.
>Mouse selection of the menu works fine initially, though.  Does anyone
>have any clues as to what could be wrong?
>
>I'm using WB2.04 and Manx Aztec C 5.2a on an A2000/2630.
>

 When your window comes up, take a look at the previously active window. If
its still highlighted (active) then you've fallen for (in Maxwell Smart
tone) "The Old WINDOWACTIVE vs WFLG_ACTIVATE trick". At least I think it
was called WINDOWACTIVE, its been a while. WFLG_ACTIVATE actually makes
your window the "active" window, while WINDOWACTIVE merely colors the
borders in. I forget what WINDOWACTIVE was originally for, but the RKM I&A
book says something about it being obsolete.

 You should peruse the 2.0 "intuition/intuition.h" for a listing of the
WFLG_ values.
From: karkan@msdrl.com (Jim Karkanias)
Subject: TCP/IP aware terminal
Organization: Merck Sharp & Dohme Research Laboratories
Date: Tue, 7 Apr 92 16:54:49 GMT

Does anybody know of a terminal emulator which also knows about TCP/IP (ala
the AS225 package)?


Jim
Newsgroups: comp.sys.amiga.programmer
From: dbenn@leven.appcomp.utas.edu.au (David Benn)
Subject: Re: Re: AmigaBASIC and AmigaOS 2 willitwork
Organization: University of Tasmania at Launceston
Date: Thu, 16 Apr 92 04:46:28 GMT

In article <1992Apr15.151917.6495@bsu-ucs.uucp>, 01ksdavis@bsu-ucs.uucp writes:
>
>
>	You bet I would be interested in testing out this compiler for you! 
>Thanx for your reply, I have gotten several already.
>	Regardless, i would like to have a copy of this compiler.  I assume it
>generates stand-alone code?
>

I assume you're asking about ACE? Yes, it does produce stand-alone code. No
shared libraries beyond the ones normally found in the libs directory are
required.

Regards...


-- 
David Benn - Applied Computing             "We dance around in a ring and  
University of Tasmania at Launceston        suppose; but the secret sits
dbenn@leven.appcomp.utas.edu.au             in the middle and knows".
                                            - Robert Frost
From: aali@dcs.qmw.ac.uk (ALI)
Newsgroups: comp.sys.amiga.programmer
Subject: C structures
Date: 16 Apr 92 21:04:30 GMT
Organization: Computer Science Dept, QMW, University of London


I have a structure thus:

struct this { 	int x;
				int y;
			};
			
I want to declare an array called temp of type struct this ie:
struct this temp[10];

However, I want to declare temp in my main() procedure. This is 
because the size of the array is figured out from a file which
contains z number of elements.The file is read by a procedure called in 
the main() procedure. So my final declaration in my main() procedure is 
supposed to be:

struct this temp[z];

where z is an int.
	However, it doesn`t work! Can anybody suggest how to do this
and if I can put my definition of my structure into a header
file?

Thanks,

Al.
From: sgberg@peach.ucs.indiana.edu (Stefan Berg)
Newsgroups: comp.sys.amiga.programmer
Subject: MC68012?
Date: 8 Apr 92 15:21:36 GMT
Article-I.D.: news.1992Apr8.102144.10385
Organization: Computer Science, Indiana University

I just had a look at the "Pocket Programming Guide" of the Devpac 3
assembler. The small booklet lists all the 68000/010 instructions.

One funny thing is it`s title:

	HiSoft Software
   MC68000/68008/68010/68012
    Pocket Programming Guide

What is the MC68012 processor? I have never heard about it!

Stefan
-- 
,----------------------------------------------------------------------------,
| Internet  - sgberg@ucs.indiana.edu             //           Stefan G. Berg |
| NeXT Mail - sgberg@arapahoe.ucs.indiana.edu  \X/ AMIGA  Indiana University |
| Bitnet    - sgberg@iubacs                   Undergraduate Computer Science |
`----------------------------------------------------------------------------'
Newsgroups: comp.sys.amiga.programmer
From: waggoner@omews7.intel.com (Mark Waggoner)
Subject: Re: Manx 5.2d + gmtime() DST problem?
Organization: Intel Corp., Hillsboro, Oregon
Date: Thu, 16 Apr 1992 00:16:55 GMT

In article <1992Apr15.174018.5968@access.usask.ca> hardie@herald.usask.ca (Peter Hardie) writes:
>conversion.
>Anybody on DST using gmtime and getting the right answer? How?
>P.S. if you live in Newfoundland have you figured out how to tell it you
>are 3.5 hours behind UTC? :-)

Manx hasn't completely implemented the gmtime call.  It does NOT adjust for
daylight savings time automatically.  I believe this is documented in
the release notes that are on the disk for 5.2d.  At this point, you have
to change the TZ environment variable when DST kicks in to, for example,
CDT7, or whatever the correct value would be.

--- // -------------------------------------------------------------------
Mark Waggoner           waggoner@ichips.intel.com         (503) 696-4182
 \X/                 Faster chips for a better tomorrow
From: Charlie_Gibbs@mindlink.bc.ca (Charlie Gibbs)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: A3000/2.04 differences for audio?
Date: 6 Apr 92 19:19:05 GMT
Article-I.D.: mindlink.11278
Organization: MIND LINK! - British Columbia, Canada

In article <46066@dime.cs.umass.edu> barrett@snoopy.cs.umass.edu
(Daniel Barrett) writes:

>        I've found out that disabling the instruction cache
>
>                cpu noinstcache
>
>fixes the problem in MegaBall and Prospector.

     Thank you, Dan.  The closest I could find was SETCPU NOCACHE,
but this makes everything work perfectly on my wife's 2500/30.

     OK, listen up, guys.  There have been some misconceptions
going around, and I'd like to clear them up before they become
too entrenched.

     It is NOT an A3000 problem.

     It is NOT a 2.04 problem.

     It IS something that will happen on any 68030, regardless of
what kind of machine it's in or what release of OS it's running.

     It's a result of programming that breaks the rules, probably
due to self-modifying code and/or fiddling with DMA.  The 68030's
caches are getting out of sync.  Disabling caching will make these
programs work on ANY 68030-powered machine - but you'll probably
want to re-enable caching once you're done with the offending
program so you can get your full processor performance back.

     I'd hate to see what would happen on a 68040...

Charlie_Gibbs@mindlink.bc.ca
"I'm cursed with hair from HELL!"  -- Night Court
From: mykes@amiga0.SF-Bay.ORG (Mike Schwartz)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: Version checking
Distribution: world
X-NewsSoftware: Amiga GRn V1.29 4/10/92 (Beta) by Mike Schwartz
Date: 12 Apr 92 01:04:01 PST
Organization: Amiga makes it possible

In article <1992Apr11.200424.5111@CS.ORST.EDU> ridgwad@jacobs.CS.ORST.EDU (Dean Ridgway) writes:
>In article <92101.155338JLKARAU@MTUS5.BITNET> JLKARAU@MTUS5.BITNET writes:
>>I have the following code in a program I am working on, which is supposed to te
>>ll a person if they don't have the right version on DOS.Library.  I request a v
>>ersion 37, 2.04.
>>
>>DOSBase = (struct DOSBase *) Open Library("dos.library",37L);
>>if(!DOSBase)
>> {printf("You need KS2.04cn");exit(20);}
>>
>>Beta testers with 2.04 are fine, Beta testers with 1.3 just guru on this.  COul
>>d someone tell me why?
>
>If you are using SAS (Don't know about Manx, DICE, etc) then the startup code in c.o
>already opens dos.library for you.  Opening it again might be causing the GURUs
>under 1.3.  You can use another library (i.e. graphics.library) or (I think)
>there is a version number inbedded in ExecBase->SoftVer that can be extracted
>and used.
>

There's no reason that opening DOS library twice from a process should cause
a guru.  However, your suggestoin about using a different library is a good
one.  I personally use intuition.

--
Author of Amiga GRn, MailMinder, Budokan, Beyond Dark Castle, Dark Castle,
and Genesis Dick Tracy and Marble Madness.
Mike Schwartz  (ames!zorch!amiga0!mykes or mykes@amiga0.sf-bay.org)
1124 Fremont Ave.
Los Altos, CA 94024

Newsgroups: comp.sys.amiga.programmer
From: rittle@hew2.cs.uiuc.edu (Loren Rittle)
Subject: Re: FAQ list/annoying SAS5.10 window
Organization: University of Illinois at Urbana-Champaign
Date: Wed, 15 Apr 1992 10:17:16 GMT

Tim Purves writes:
>In the blink file, just add a line. 'define __main=__tinymain'

And then rknop@cco.caltech.edu (Robert Andrew Knop) writes:
>According to P. 14-15 of the "Customer Service Guide" that came with the 5.10b
>upgrade (from 5.10a) that I got, you can get rid of that window by putting the
>statement "DEFINE __main=__tinymain".

You need to be careful as __tinymain doesn't open stdin streams as
__main does.

The only way SAS provides to get rid of the startup window, but yet
retain stdio streams is to manually hack _main.c (called _umain.c and/or
umain.c and/or __main.c in past revisions of Lattice and SAS/C).  This
file, _main.c, is included in lc:/source.

Programs that use the 'define __main=__tinymain' trick and then try to
use the io package may crash.

>However, this doesn't seem to work for me.  First, when compiling, it tells me
>I have an undefined symbol y-with-an-umlaut (one character long) first
>referenced in <UNKNOWN>.  Then, when it is nearly done compiling, after the
>"final output" statement, it says, "_main: Unknown command."

Humm, no clue.  Never seen this.

>In spite of these errors, the compiled executable still seems to run.  BUT, I
>still get the annoying window on the workbench!

>Any suggestions?

Yes, try looking at the first article I posted. :-)

>>You need to modify _main.c (in the 5.10b w/ ansi libs version, called
>>__main.c before then I believe) and recompile.  This file should be
>>located in lc:/source.  If the changes are straight foward for you,
>>I can help via email.

>I would be interested in seeing this.  I am a tad clueless; does _main.c
>compile to c.o in the libs: directory?  If so, then I suppose it would be a
>good idea to give it a different name when recompiling a modified version.
>(And, I assume you could use this by linking to your different name instead of
>to c.o in your blink statement, right?)

NO, _main.c compiles to an object that is normally placed in lib:lc.lib (and
friends).  You can override the library version by compiling _main.c in
the directory with your project and then adding _main.o on the blink
command line.

With all the above said:

If you don't care to use stdio.  You can name your entry routine as
_main() instead of main() and avoid the whole issue.  I have posted a
good number of articles about this subject.  If you still need help,
I can via email (if you are nice :-).

Regards,
Loren
From: sck@watson.ibm.com (Scott C. Kennedy)
Newsgroups: comp.sys.amiga.programmer
Subject: Re:  middle mouse button
Date: 6 Apr 92 17:50:22 GMT
Distribution: na
Organization: IBM T. J. Watson Research Center
Disclaimer: This posting represents the poster's views, not necessarily those of IBM

In article <mkoch.00yl@amisys.UUCP>, mkoch@amisys.UUCP (Mike Koch) writes:
|> In article <1992Mar25.145006.8354@iesd.auc.dk> labben@iesd.auc.dk (Lars Bodin) writes:
|> >In article <1992Mar25.114910.5279@cs.umu.se> dvljrt@cs.umu.se (Joakim Rosqvist) writes:
|> >>I hope I'm wrong, but I don't think the Amiga can read 3 mousebuttons.
|> >
|> >You sure are wrong ;^) I have an optical mouse with three buttons and
|> >a nice commodity (I'm running WB2.04), which allows me to use the
|> >_middle_ button for clicking windows and screens to back/front.
|> 
|> Anybody know the name of this commodity, and where I can get my hands on it?
|> And if all you can give me is an ftp site, while it may interest a few others,
|> it won't help me because I "can't get there from here."  :-)  Alternatively,
|> maybe some kind soul would be nice enough to send it to me via email.  ;-)

I'm also looking for a MMB program that will allow me to use the conclip feature
of AmigaDOS. ie. (ala X-windows) using right mouse button, select text to copy, 
then move into desired window and hit the middle mouse button.

I'm going to sit down and write one if noone has already done it, but if people 
have already done one, I'd be quite happy to use it.
-- 
------------------------------------------------------------------------------
Scott C. Kennedy (sck@watson.ibm.com)  | This post does not reflect the intent 
Distributed High Performance Computing | or actions of my employer, and their 
IBM Thomas J. Watson Research Facility | actions don't reflect mine either.:)
------------------------------------------------------------------------------
****************** CAUTION: DEADLIEST JOKE IN THE WORLD **********************
"Venn ist das nurnstuck git und Slotermeyer?
 Ja! Beigerhund das oder die Flipperwaldt gersput!"
Xref: sparky comp.sys.amiga.programmer:7609 comp.sys.amiga.audio:2212