HDTenEightyP/NetNews huggingface dataset:
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.lang.c
Subject: Re: compilers and code generation (struct vs. array)
Date: 8 Jan 93 00:12:25 GMT
Reply-To: dave@cs.arizona.edu (Dave Schaumann)
Organization: University of Arizona

In article <1ihl0vINNof1@life.ai.mit.edu>, sundar@billberry (Sundar Narasimhan) writes:
>Let's say a point is defined as
>	struct point { 
>		double x, y;
>        }
>or as
>typedef double point[2];
>
>I'm interested in the usual operation on points. (i.e. 
>additions, subtractions, multiplications, co-ordinate access,
[...]
>Do compilers usually generate the same code in both the above
>cases?

It's dangerous to say anything about what "compilers usually generate";
there's a large range of qualities of implementation out there.

That said, the short answer is "probably yes".

The long answer is that from a code generation point of view, a struct
reference can be viewed as a base address plus a constant offset, and
an array reference can be viewed as a base address plus a (potentially)
variable offset.  In the case where you always use constant indexes in
your arrays, it's a fairly easy optimization to generate the same code
as would be generated for a struct offset.  Since C compilers are required
to recognize constant expressions anyway, one would assume that most
compilers would get this.

On the other hand, if it doesn't get this right, it's probably generating
poor code elsewhere too, so that the difference between p.x and p[0] is
probably going to be overwhelmed by other things anyway.

I'd say just go with what seems most natural.  This is probably good
advice in any coding concern.  The big wins in optimization are far
more in the area of designing basic algorithms than they are in the
fine-tuning area of deciding between "p.x" and "p[0]".  If your program
runs too slow, use a profiler.  Humans can do a pretty fair job when
it comes to designing a complex system like a computer program, but
when it comes to finding where it spends most of its processing time,
we come in a (very) distant second to a simple automated accounting.

-- 
Caught an internal error--.brainrc restored
From: Raj.Subramani@newcastle.ac.uk (D. Subramani)
Newsgroups: comp.lang.c
Subject: Re: Moving from Pascal to C, Help please!!!!!!
Date: 31 Dec 92 10:51:39 GMT
Organization: University of Newcastle upon Tyne, UK, NE1 7RU

gt6758b@prism.gatech.EDU (Michael Maverick Kopack) writes:

[stuff deleted]


>There are a lot of things about C that I find very frustrating after comming
>from a decent course in Pascal. For one is the way that Arrays are handled.
>I like being able to do stuff like    array [6..26] of int whereas in C you
>get forced into calling the indeces 0-19. I also HATE that there are no true 
>pass by reference parameters! 

[stuff deleted]

I would recommend that you have a look at "Numerical Recipies in C"
'cause there they explain how arrays of 2-D are pointers to a pointer
and so on which no one else does. Also they have a few routines that
allocate memory as per your requirement, ie. [6...26] etc. but be 
warned, when you do that you will not be able to exploit the advantages
of pointer arethmatic fully (it will be too confusing).

Its best to stop thinking as you did in Pascal/Fortran, to a certain
extent, when using C (easier said than done).

Have a error free New Year.

raj.subramani@newcastle.ac.uk
From: olw7845@zeus.tamu.edu (Zeke E. Pez)
Newsgroups: comp.lang.c
Subject: Borland TC++ 3.0 and Pharlap Dos Extdrs'
Date: 10 Jan 1993 14:53 CST
Organization: Texas A&M University, Academic Computing Services
Distribution: world
NNTP-Posting-Host: zeus.tamu.edu
News-Software: VAX/VMS VNEWS 1.41    

Does the combination of Turbo C and Pharlap Dos Extdrs when combined
allow me to use a pointer that points to a allocated chunk of memory
that is 2megs or larger?

If so, do I need to use "huge" pointers to break the 64k barrier limit
of ANSI C?

If the answer to the first question is yes, Is there alot of B.S. Handwaving
discreet details in acheiving this pointer allocation?

Thanks,
Zeke
From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail)
Newsgroups: comp.lang.c
Subject: Re: Problem with string processing.
Date: Tue, 05 Jan 93 21:36:43 CST
Organization: Villa CyberSpace, Minneapolis, MN

dkeisen@leland.Stanford.EDU (Dave Eisen) writes:

> >Roy M. Silvernail (roy%cybrspc@cs.umn.edu) writes:
> >
> >| Assuming a large enough string for the append, and low-high byte ordering,
> >| would this work?
> >|
> >| strcat(str,(char *)&ch);
> 
> I think Roy was being cute here.

<blush>

> So Roy's trick, if I am understanding him correctly, will work
> fine on a system where a number of assumptions are correct. I'll
> let Roy defend the usage of his trick from those who would 
> argue it is not good style.

Defend it?  Dave, I didn't even know if it would work... :)

Thanks for a very thorough explanation (which I deleted to save a few
bytes).  I don't think I'll be using this one too often.
--
    Roy M. Silvernail   | #include <stdio.h>                 | "press to test"
 roy%cybrspc@cs.umn.edu | main(){                            |     <click>
 cybrspc!roy@cs.umn.edu |  float x=1;                        | "release
                        |  printf("Just my $%.2f.\n",x/50);} |    to detonate"
From: hartman@ulogic.UUCP (Richard M. Hartman)
Newsgroups: comp.lang.c
Subject: Re: Problem with string processing.
Date: 6 Jan 93 01:44:52 GMT
Distribution: usa
Organization: negligable

In article <MCGLK.93Jan5005833@yang.cpac.washington.edu> mcglk@cpac.washington.edu (Ken McGlothlen) writes:
>Roy M. Silvernail (roy%cybrspc@cs.umn.edu) writes:
>+----------
>| [regarding the C statment:  while (*ptr++ = *str++);  ]
>|
>| (nice touch, BTW) How does this differ from 'strcpy(ptr, str)' besides the
>| function call overhead?
>+----------
>
>It doesn't.  In fact, that's often how strcpy() is implemented.

Actually, on systems w/ block memory move supported at the
CPU level, memcpy() can be implemented much more efficently.
If there were a decent way of getting the string length w/o
counting all the bytes then direct support for strcpy() could
be done easily.  Are there any CPUs that have a single-instruction
way of saying "find the next 0 byte & tell me how far it was from here"?



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
And when you stop and think about it	|
(you won't believe it's true)		|	-Richard Hartman	
That all the love you've been giving	|	hartman@uLogic.COM
has all been meant for you.		|
Newsgroups: comp.lang.c
From: mjs@hubcap.clemson.edu (M. J. Saltzman)
Subject: Re: Unsolveable bug
Organization: Clemson University, Clemson SC
Date: Fri, 8 Jan 1993 17:00:40 GMT

In article <131@mccoy.dbaccess.com> steve@dbaccess.com (Steve Suttles) writes:
>[...]
>Forget about bugs in malloc implementation.  They would have been
>found.  

Well, it would be nice if this were true, but I just found one last week.
To be sure, this is the last thing to suspect, and search for such a 
bug should only be undertaken when all other possibilities have been
rigorously eliminated.  Also, the odds are that for widly-used systems,
malloc() is pretty well shaken down by now.

>While your mistake might be in the area of malloc'ed memory,
>it is a mistake in the requests that were made, rather than the
>fulfillment of those requests.  But if you honestly believe you
>haven't messed up with malloc, don't give up; keep looking until you
>find it.  Computers only do what they are told, after all...
>
>When one is discovered that doesn't, it gets sent out to be fixed.
>
>sas
>-- 
>Steve Suttles                Internet:  steve@dbaccess.com      Dr. DCL is IN!
>CROSS ACCESS Corporation     UUCP: {uunet,sgiblab}!troi!steve  Yo speako TECO!
>2900 Gordon Ave, Suite 100   fax: (408) 735-0328              Talk data to me!
>Santa Clara, CA 95051-0718   vox: (408) 735-7545   HA! It's under 4 lines NOW!


-- 
		Matthew Saltzman
		Clemson University Math Sciences
		mjs@clemson.edu
Newsgroups: comp.lang.objective-c
From: FLETCHERJP@aston.ac.uk (John Fletcher)
Subject: Re: GNU Objective-C discussion
Organization: Aston University
Date: Mon, 4 Jan 1993 11:43:04 GMT

In article <1992Dec30.044951.2956@Trirex.COM> dglattin@trirex.com (Dennis Glatting) writes:

>In article <BzzDzB.4Ky@cs.dal.ca> kelley@cs.dal.ca (Dan Kelley) writes:
>> |> Richard Stallman believes it is too early to start a gnu-objc
>> |> newsgroup.  So I wonder if this group, comp.lang.objective-c, would
>> |> tolerate general discussion of GNU Objective-C.
>> 
>> Speaking as a 'reader', not a 'writer' to this group, I'd have to say
>> PLEASE do post gnu stuff here.  I've been tantalized by the discussion
>> of obj-c, but we don't have a compiler here that handles it.
>> 
>> Although we have gcc-1.37.1 and gcc2.2.2, when I try to compile the  
>sample
>> program from the FAQ, it dies because it cannot locate objc/Object.h.   
>I've heard
>> that the present gnuC doesn't have proper runtime libraries, so I wonder  
>whether
>> this is the problem, or is it just that our gcc isn't installed  
>properly?  To put
>> it simply, might a presently-available version of gcc be able to compile  
>the
>> program called 'sample' from the FAQ stored on music.sie.arizona.edu?   
>If so,
>> I'd be interested in trying it out.
>> 

>I can't speak for the example in the FAQ but there is a sleazy test suite  
>available for the current GNU run time -- yes, the run time does exist, it  
>is available, and it does work, but it is in its infancy.

>Cruising through my file store...   Yes, there is a objc/Object.h.   
>However, I'm using gcc 2.3.2 and I had to install the include files and  
>libraries by hand.

>I've just looked at the example in the FAQ.  Where do these objects come  
>from?
>#import "Queue.h"
>#import "Stack.h"

>--
>Dennis P. Glatting / Sr. Technical Manager / Trirex Systems Inc.
>315 Post Road West / Westport, Connecticut 06880 / (203)221-4600
>dennis_glatting@trirex.com (NeXTmail Ok)
>Member League for Programming Freedom

I am using DJGPP (Version 1.08) which contains GCC 2.2.2, not 2.3.2.
Do the definition files works with GCC 2.2.2?  If so, where can they be 
found?

John
--------------------------------------------------------------
Dr John P. Fletcher       
Department of Chemical Engineering and Applied Chemistry,
Aston University,         Tel: (44) 21 359 3611 ext 4625
Aston Triangle,		  Email(Janet): J.P.FLETCHER@UK.AC.ASTON
BIRMINGHAM B4 7ET   U.K.  Email(Other): J.P.FLETCHER@ASTON.AC.UK
--------------------------------------------------------------
From: dlivings@cs.strath.ac.uk (Daniel J Livingstone IE90)
Newsgroups: comp.lang.objective-c
Subject: parser source - lex/yacc
Date: 11 Jan 93 16:18:25 GMT
Distribution: comp.object comp.lang.objective-c
Organization: Comp. Sci. Dept., Strathclyde Univ., Glasgow, Scotland.


   I require lex/yacc source for an obj-c compiler...
   I believe that obj-c has (to some extent) anyway been
   covered by the gnu c++ compiler. Is source for this
   (or other obj-c compiler) available anywhere PD?

thanks, Daniel
-- 
dlivings@cs.strath.ac.uk
- Reality is what you make it
Newsgroups: comp.lang.objective-c
From: gsk@world.std.com (Geoffrey S Knauth)
Subject: gnu-objc-submissions
Keywords: GNU objective-c
Organization: The World Public Access UNIX, Brookline, MA
Distribution: na
Date: Tue, 12 Jan 1993 02:44:35 GMT

In article <C05HIw.CAE@cs.dal.ca> kelley@open.dal.ca (Dan Kelley) writes:
>After watching lots of "yes" votes role in over the last few days, and
>not a single "no" vote, I wonder if it's time for the GNU folks to
>tell us what they have to say.  Can somebody please post a summary of
>what's in the GNU runtime library?

The answer is, very little so far.  Contributions have been few.

If you would like to submit code for this project, no matter what
shape it's in, send it to gnu-objc-submissions@prep.ai.mit.edu.  You
can subscribe to receive submissions by asking
gnu-objc-submissions-request@prep.ai.mit.edu.  Absolutely no flaming
of fledgling authors is allowed; you have to promise to be nice.

All code must be yours to share, and later, for it to be included in
the GNU project, you must sign a piece of paper to fulfill legal
requirements.

Geoffrey, GNU Objective-C Admin
-- 
Geoffrey S. Knauth, Marble Associates, Inc.                Member BCS-NeXT, LPF
gsk@marble.com, (617) 891-5555                             Standard Disclaimers
Newsgroups: comp.lang.objective-c
From: sailer@hpuerca.atl.hp.com (Lee Sailer)
Subject: Re: GNU Objective-C discussion
Date: Mon, 4 Jan 1993 14:48:30 GMT
Organization: Hewlett-Packard NARC Atlanta
X-Newsreader: Tin 1.1.3 PL5

Dan Kelley (kelley@cs.dal.ca) wrote:
: |> Richard Stallman believes it is too early to start a gnu-objc
: |> newsgroup.  So I wonder if this group, comp.lang.objective-c, would
: |> tolerate general discussion of GNU Objective-C.
: 
: Speaking as a 'reader', not a 'writer' to this group, I'd have to say
: PLEASE do post gnu stuff here.  I've been tantalized by the discussion
: of obj-c, but we don't have a compiler here that handles it.
: 

I agree.  GNU Obj-C is Objective-C, is it not?  Therefore, discussions
of it belong in this group.  Likewise, I think a lot of the discussion
over in the NeXT programmer groups is really Obj-C discussion, in disguise.

If and when the traffic here gets too intense, we can think about creating
new subgroups.
-- 
Lee Sailer

					- Let's leave my employer
					  out of this, OK?
From: story@sgi.com (David (Duis) Story)
Newsgroups: comp.lang.postscript
Subject: Re: Postscript to HP Series II converter?
Date: 7 Jan 93 23:19:39 GMT
Organization: Silicon Graphics, Inc.

In article <lkot5oINNrmc@peaches.cs.utexas.edu> tyen@cs.utexas.edu (Anthony Yen) writes:
>In article <1993Jan1.234855.5391@vpnet.chi.il.us> ron@vpnet.chi.il.us (Ron Winograd) writes:
>>Does anybody have a post script to HP series II unix based convertor?
>
>I would be interested in such an animal, too.  

Silicon Graphics sells just such a beast for use on any SGI box
running IRIX 4.0.1 or later.  It's called Impressario, it's $800 for
the printer server, and it screams.

Impressario converts text, SGI image, and PostScript (and a number of
other formats) to print on HP Series II and III (PCL4 and above)
printers.  It includes format conversions, and even does line-by-line
adaptive compression to ensure the fastest transmission times.

For more information, contact SGI Express at 800-800-SGI1 (7441).

Cheers,

David Story                        	        Silicon Graphics, Inc.
story@bent.wpd.sgi.com				Mountain View, California

I've changed my name, so duis@sgi.com may bounce, please use story@sgi.com.
Newsgroups: comp.lang.postscript
From: zhao@nmsu.edu (Z. Zhao)
Subject: how to print out ZEN.1.0.ps
Reply-To: zhao@nmsu.edu
Organization: Computing Research Lab
Date: Tue, 5 Jan 1993 15:21:19 GMT

I have got the book script "ZEN.1.0.ps". But, I cannot print out it on
PC. I really doubt that it is in PostScript format. In the front, it
says, 

%!PS-Adobe-2.0
%%Creator: dvips 5.47 Copyright 1986-91 Radical Eye Software
%%Title: zen-1.0.dvi
%%Pages: 102 1
%%BoundingBox: 0 0 612 792
%%EndComments
%%BeginProcSet: tex.pro
/TeXDict 200 dict def TeXDict begin /N /def load def /B{bind def}N /S /exch
load def /X{S N}B /TR /translate load N /isls false N /vsize 10 N /@rigin{
isls{[0 1 -1 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
Resolution VResolution vsize neg mul TR matrix currentmatrix dup dup 4 get
round 4 exch put dup dup 5 get round 5 exch put setmatrix}N /@letter{/vsize 10
N}B /@landscape{/isls true N /vsize -1 N}B /@a4{/vsize 10.6929133858 N}B /@a3{
/vsize 15.5531 N}B /@ledger{/vsize 16 N}B /@legal{/vsize 13 N}B /@manualfeed{
statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N
......


What kind of format is it in ?
What kind of software do I need to translate this file into readable
	output ?
Where can I get this suitable software ?
How can I print out the ideal text from it on my PC ?

My printer is HP IIII (4 :). It is supposed to recognize PostScript
format. On UNIX workstation we could simply feed a APPLE printer
with a PostScript file by
	lpr xxxx.ps
What can I do with PC's ?


Regards,

ZiZi
Newsgroups: comp.lang.postscript
From: justin@tasman.cc.utas.edu.au (Justin Ridge)
Subject: Cancelling jobs being processed (Q)
Organization: University of Tasmania, Australia.
Date: Tue, 5 Jan 1993 06:00:40 GMT

Hi... a question for anyone:
Is it possible to cancel a job which is being processed in a PS printer -
specifically, in a Apple LaserWriter IINT/NTX/f/g?
That is, send a command to the printer which will remove the job that
the printer is presently working on, when:
a) the job is in the process of being downloaded
or
b) when it has been downloaded and is being drawn by the LW.

Thanks for any advice,
Regards,
Justin Ridge.

Newsgroups: comp.lang.postscript
From: psikr01@convex.zdv.uni-tuebingen.de (Peter Kretschmar)
Subject: How do I read a file from the DEC LN03 PS printer?
Summary: see subject
Keywords: file access, file operator, DEC printer
Organization: Comp. Center (ZDV) U of Tuebingen, FRG
Date: Mon, 11 Jan 1993 16:31:41 GMT

Hello,
I'm posting in behalf of a colleague who hasn't found his way around to
Usenet yet. He want's to have a PostScript job running on our DEC LN03
printer to read in a file from disk. He tried to use some code, that worked
on a HP printer, connected to a Unix system:

  (name_of_file) (r) file

but this didn't work out with the DEC LN03. He already tried some more
obvious variations like giving the full VMS filename (at least, that's what
he told me). We don't seem to have much documentation on the printer, and
he hasn't got a clue what to change, or if this is possible at all.

Any input, especially hints and pointers to more information would be
very welcome (I looked through my copy of the PS FAQ already).

Thanks in advance,
Peter

--
Peter Kretschmar
psikr01@convex.zdv.uni-tuebingen.de
From: zisk@adobe.com (Stephen Zisk)
Newsgroups: comp.lang.postscript
Subject: Re: Mirror Images
Date: 11 Jan 93 16:29:14 GMT
Followup-To: comp.lang.postscript
Distribution: na
Organization: Adobe Systems Incorporated

In article <1993Jan6.192218.23383@news2.cis.umn.edu>,
saranen@staff.tc.umn.edu (David Saranen) wrote:
> Is there a way to print out a mirror image of a postscript file?
One simple way to do this is to put the following code at the top
of your file:
  612 0 translate
  -1 1 scale

This will fail on multi-page jobs or if your file has "initgraphics"
or certain other operators, but it is so simple it is worth a try.
It also presumes you want to flip horizontally, and your paper size
is 612 units wide (i.e. letter or legal, but not tabloid).

> In the red book, there is a reference to MirrorPrint under 
> setpagedevice; but apparently it is hardware dependent.
This key is both device-specific and Level 2-specific. Sorry!

Stephen Zisk (zisk@adobe.com)  Disclaimer: These are my personal views
Adobe Systems Incorporated     and do not represent the position of
Eastern Regional Office        Adobe Systems Incorporated.
24 New England Exec. Park
Burlington, MA 01803           They pay me but they don't muzzle me!
Newsgroups: comp.lang.postscript
From: zisk@adobe.com (Stephen Zisk)
Subject: Re: How do I read a file from the DEC LN03 PS printer?
Followup-To: comp.lang.postscript
Organization: Adobe Systems Incorporated
Date: Tue, 12 Jan 1993 23:26:35 GMT

In article <psikr01.726769901@convex>,
psikr01@convex.zdv.uni-tuebingen.de (Peter Kretschmar) requested
information on reading files fromn the LN03 and made a comment
about reading on an HP printer.

THE SHORT ANSWER:
What you want cannot be done. I don not know any "standard" PostScript
printers which can read files from their host systems. This would be
possible for certain network-connected printers (although I do not
know of any which implement this), and it would be easy for software-
based rips (e.g. CPSI from Adobe can do this).

THE LONG ANSWER:
The read operator in PostScript allows reading from a file which is
available to the printer. This includes two classes of files:
    1.) Attached disks or virtual disks. These can be internal or
        external. Many cartridges behave as read-only file systems.
        A few printers accept flash-ram cartridges which behave as
        read-write file systems. Software rips generally treat host
        file systems as attached disks.
    2.) I/O devices. currentfile is an operator which allows a
        PostScript program to read from the current job stream.
        On a level 2 printer, read can be issued against any port.
        The simple currentfile case is used commonly in PostScript,
        for example to read image data. The general case requires
        communication via multiple ports, with some manner of
        synchronization if it is to be used generally.

There are two main problems with implementing a printer which can
read from its host's file system:
    1.) Establish a communications protocol which is rich enough
        to allow file I/O. With network connections (at least TCP/IP,
        NETWARE, and Ethertalk over Ethernet, and Localtalk), this is
        possible, but a protocol must be chosen, and published, and
        some S/W must be written to take advantage of it. For serial
        connections, this is problematic, and for unidirectional
        parallel, impossible.
    2.) Establish conventions for file control. This includes file
        names, path names, record conventions, binary interpretation,
        and more esoterica (logical names in VMS, aliases on the Mac,
        translation of volume letters to network references on the PC,
        and so on). If you want to solve this problem in a general way,
        good luck! For simple cases, where the characteristics are
        tightly controlled, it would be easier, but not too useful.

I hope this clears things up, if only in a negative way.

Stephen Zisk (zisk@adobe.com)  Disclaimer: These are my personal views
Adobe Systems Incorporated     and do not represent the position of
Eastern Regional Office        Adobe Systems Incorporated.
24 New England Exec. Park
Burlington, MA 01803           They pay me but they don't muzzle me!
From: ratcliff@ucsd.edu (John Ratcliff)
Newsgroups: comp.lang.postscript
Subject: Looking for mac postscript previewer
Date: 6 Jan 93 23:02:02 GMT
Followup-To: comp.lang.postscript
Organization: ucsd

Are there any good postscript previewers available for the Mac
that can display any laserwriterable file?

Thanks for any pointers, public domain or commercial.

John Ratcliff
UCSD Engineering
ratcliff@ucsd.edu
Newsgroups: comp.lang.postscript
From: mek@hydrox.enet.dec.com (Mark Klamerus)
Subject: use of ghostscript on VMS
Date: Wed, 6 Jan 93 08:11:12 PST
X-Received: by usenet.pa.dec.com; id AA10052; Wed, 6 Jan 93 08:11:13 -0800
X-Received: by enet-gw.pa.dec.com; id AA05626; Wed, 6 Jan 93 08:11:12 -0800
X-Received: from hydrox.enet; by decwrl.enet; Wed, 6 Jan 93 08:11:12 PST
X-To: comp.lang.postscript.usenet
X-Apparently-To: comp.lang.postscript.usenet


	I'm trying to build ghostscript on VMS.

	It comes with VMS-CC.MAK (which is really a *.COM) file
	for doing this.  And it does seem to compile and run using
	only the X windows driver.  When I try to build for supporting
	GIF output files it also compiles, but crashes when run.

	Has anyone gone through this and gotten the VMS version to
	work with output to a GIF (or PBM or other) file?

	I could really use any input anyone has on this or if anyone
	has any other method of getting from PostScript to image on VMS.

	thanks,

	Mark Klamerus
Newsgroups: comp.lang.postscript,comp.text.desktop