HDTenEightyP/NetNews huggingface dataset:
From: tjgorn01@rigel.spd.louisville.edu (Tim Gornet)
Subject: Converting MASM in makefile to use inline assembler
Organization: University of Louisville
Date: Tue, 21 Jul 1992 19:28:15 GMT

I am attempting to compile some software using a makefile in Microsoft C
version 6.0. I do not have the Macro Assembler MASM but need to compile
some software that calls the MASM. I am not a C programmer, but am usually
able to debug and compile with a little effort. I have also checked through
the C and advanced C techniques books from MS and can't find the answer to my
question. 
Following is a representation of my makefile that I am using. I am able to
get all the C stuff to compile but it blows out at the MASM stuff. Since I do
not have MASM is there any way I can edit the makefile so that it uses the 
inline assembler that is included with C to get this beast to compile. I am
not knowledgable enough to edit any of the files being compiled. Or do I have
to get MASM to get this to work. Thanks for any help.

---- Start of Makefile

F = -FPi
CFLAGS1 = -nologo -c -Ot -AL -DMSC -DPC $(F)
CFLAGS2 = -nologo -c -Ot -AL -DPC -DMSC -DSIGMA -DCGA -DEGA -DVGA -DHERCULES -DPOSTSCRIPT -DHPGL -DDXY $(F)
MFLAGS = -MX
HDRS= VOGLE.H

...
--- A bunch of C targets that compiled okay
...

MOUSE.OBJ:        ..\DRIVERS\IBMPC\MOUSE.ASM
	MASM $(MFLAGS) ..\DRIVERS\IBMPC\MOUSE;

MISC.OBJ:        ..\DRIVERS\IBMPC\MISC.ASM
	MASM $(MFLAGS) ..\DRIVERS\IBMPC\MISC;

.....
--- Some more MASM calls to end of file.
...
-- 
--------------------------------------------------------------------------
Tim Gornet					PHONENET: (502)588-0714
  Computer Aided Engineering Consultant 	FAXNET  : (502)588-8890 
						SLUGNET:
INTERNET: tjgorn01@starbase.spd.louisville.edu	  CAE Center
BITNET  : tjgorn01@ulkyvx.bitnet         	  University of Louisville
         					  Louisville, KY 40292
--------------------------------------------------------------------------


Newsgroups: comp.lang.c
From: hoekjw@utrcu1.civ.utwente.nl (Hoek J.W. van den)
Subject: Help: double real conversion between calma/gdsII and sunC or TurboC
Summary: the subject says it all
Keywords: conversion, sunC, Turbo C, double real, calma/gdsII
Organization: Hollandse Signaalapparaten b.v.
Date: Wed, 22 Jul 1992 09:40:21 GMT


Can anyone help me (or actually a colleague of mine) with the following:
------------------------------------------------------------------------

A program is needed that converts double reals in GDSII format:
	1 sign bit, 7 exponent bits, 56 mantisse bits
into a C double real:
	1 sign bit, 11 exponent bits, 52 mantisse bits

and another program to convert the C double reals into GDSII format again.


*Anything* (hints, similar experiences, C-programs, etc.) is welcome.
Please respond by email. Thanks a lot.

							Jan-Willem
From: kjb@cgl.citri.edu.au (Kendall Bennett)
Newsgroups: comp.lang.c
Subject: Re: Balancing Binary Search Trees
Date: 30 Jul 92 01:56:37 GMT
Organization: RMIT Advanced Computer Graphics Centre, CITRI, Melbourne

Alan.Tai@bbs.oit.unc.edu (Alan Tai) writes:

>I currently have a binary search tree to store an alphabetized list of
>words, but would like it to be optimized for speed of retrieval.  Could
>someone please post some example code for balancing binary trees, or
>even suggest a book that might have this code.  So far, I haven't come
>across any texts that have this, though.  Thanks!

This one is as widely published as the binary tree algorithm. There are
a number of different algortithms to do this, AVL trees, Red Black trees
and just recently Splay Trees. I can't remember the name of paper on splay
trees by Sleator and Tarjan, but I think I saw some code for them in the
GNU libg++ archive.

Anyway, you can get C code to implement AVL tree from my 'ctools10.tar.Z'
archive (.zip version is on simtel20 and garbo), which can be ftp'ed from

	godzilla.cgl.rmit.oz.au

as:

	kjb/ctools10.tar.Z

+------------------------------------------+-------------------------------+
| Kendall Bennett,                         | Internet:                     |
| Advanced Computer Graphics Centre,       | kjb@godzilla.cgl.citri.edu.au |
| Royal Melbourne Institute of Technology, | rcskb@minyos.xx.rmit.oz.au    |
| Victoria, AUSTRALIA.                     |                               | 
+------------------------------------------+-------------------------------+
| CoSysop (Bossman), PC Connection Australia:               +61 3 688 0909 |
+--------------------------------------------------------------------------+
Newsgroups: comp.lang.c
From: muessig@ipf.bau-verm.uni-karlsruhe.de (Peter Muessig Tel 0721 608 4131)
Subject:  WANTED: lex-style C grammar
Keywords: lex, C
Reply-To: muessig@ipf.bau-verm.uni-karlsruhe.de
Organization: IPF, University of Karlsruhe
Date: Thu, 30 Jul 1992 13:03:06 GMT

Hello,

some days ago I read about a lex-style C grammar. Where can I find such a
thing.

Thanks in advance

Peter

--

Peter Muessig, IPF-Universitaet Karlsruhe, Englerstr. 7, D-7500 Karlsruhe
Phone: +49 721 608 4131                              Fax: +49 721 694 568
Internet: muessig@ipf.bau-verm.uni-karlsruhe.de
From: EE117@LIVERPOOL.AC.UK
Newsgroups: comp.lang.c
Subject: don't try this at home kids  / cont'd
Date: 16 Jul 92 15:48:24 GMT
Organization: University of Liverpool

... O/S security aint what it used to be these days but it didn't
seem like a good idea.

-Ian.

P.S. sorry about the break there - I accidently hit the PF5 (post) key
    and in less time then it takes the above prog to iterate the document
    disappeared off to the netserver.


------------------------------------------------------------------------
You won't get wise                    +  Ian C. Smith,
With the sleep still in your eyes     +  Department of Elec. Eng.
No matter what your dreams might me   +  University of Liverpool.
 - Rush ( fine purveyors of home-spun +  email:
          philosophy since 1973 )     +    ee117 @ ibm.liv.ac.uk
-------------------------------------------------------------------------------
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.lang.c
Subject: Re: Pointers to freed memory
Date: 31 Jul 92 08:12:14 GMT
Organization: AND Software BV Rotterdam

In article <1992Jul30.164035.7349@taumet.com> steve@taumet.com (Steve Clamage) writes:
|jos@and.nl (Jos Horsmeier) writes:
|
|>In article <1992Jul29.205834.11308@hubcap.clemson.edu> mjs@hubcap.clemson.edu (M. J. Saltzman) writes:
|>|I know that a pointer to freed memory should never be dereferenced, 
|>|but is it standard-conforming to assign or do arithmetic with such
|>|pointers?
|
|>As long as you do not dereference such a pointer (as you indicated
|>yourself,) everything is fine.  If pointer q contained a valid pointer
|>value _before_ the call to free(), it'll contain a valid pointer value
|>_after_ the call.
|
|This is not necessarily the case, although it is safe for many common
|architectures.
|
|The C Standard states that the value of the pointer after a call to free
|is 'indeterminate'.  This means that just reading the value might
|produce a runtime fault.

[ example deleted ... ]

You're right. Absolutely right. Someone else e-mailed me about this and
told me exactly the same thing. I am stunned ... I never could have 
imagined a processor architecture where a validation on an address
value would be done while just _loading_ that particular value. But
such (ugly) animals seem to exist; I've never had the `pleasure'
to meet one ...

kind regards,

Jos aka jos@and.nl
Newsgroups: comp.lang.c
From: amorgan@Xenon.Stanford.EDU (Crunchy Frog)
Subject: Re: About the 'F' in RTFM
Organization: Computer Science Department, Stanford University.
Date: Wed, 22 Jul 1992 19:52:51 GMT

In article <l6rbffINN8hu@appserv.Eng.Sun.COM> 
  limes@ouroborous.Eng.Sun.COM (Greg Limes) writes:
>In article <1992Jul17.202448.19848@wyvern.twuug.com> 
>  alpha@wyvern.twuug.com (Joe Wright) writes:
>> Proposed change to 'standard' practice.  'RTFM' is now 'RTM'.
>> The 'F' does not relate to any known adjective for Manual.
>> 'Read The Manual' should suffice.
>
>When some bonehead calls you up for the third time in an hour asking
>questions the he can find in Section I of the Unix Programming Manual
>or (worse) in the READ ME FIRST!!! document, telling him to RTM just
>does not have enough emotional impact.

Indeed, I sometimes use RTMFM.  In extreme cases I even put an A at the end.

C Frog
From: murphy@npri6.npri.com (David P. Murphy)
Newsgroups: comp.lang.c
Subject: Re: While problem
Date: 27 Jul 92 20:58:34 GMT
Distribution: world
Organization: NPRI, Alexandria VA


 >    I'm having trouble with a whil loop in function I am writing to
 > read a line from a fileby puttingeach character into an array, accesed by
 > pionters, until the '\n' character is reached of EOF is reached.
 >   Trouble is, I keep getting an error message that the function needs an
 > Lvalue (address) inside the while loop.  Any ideas as to the problem?
 > The filename is a global variable, and that's why it isn't declared.
 >
 >                 gnr100@psuvm.psu.edu
 > ------------------------Begin Code-------------------------------------------
 > char readline(char *string[])
 > {
 >   int i=0;
 >
 >   while(((*string+i++=(char)getc(fname))!=EOF)
 >       &&((*string+i++=(char)getc(fname))!='\n'));
 >   return (*string+(i-1));
 > }
 >
 ><GNR100@psuvm.psu.edu>

the answer has already been posted, so i feel primed to FLAME ON . . .

can anyone explain to me how mr. gnr100 can have the gall to ask for help
when his code is so deliberately obfuscated?

DON'T max your code into as few characters as possible.
DON'T push everything into a while loop.
DO break it up over several lines --- i know, it'll hurt, but do it anyway.
and DON'T come crying on the net for a stupid problem like this.

ok
dpm
-- 
murphy@npri6.npri.com 602 Cameron St. Alexandria, VA 22314 (703) 683-9090

              When every one is dead the Great Game is finished.  Not before.
                              --- Hurree Babu, "Kim"
From: robertk@taoami.lerctr.org (Robert Kesterson)
Newsgroups: comp.lang.c
Subject: Re: While problem
Distribution: world
X-NewsSoftware: GRn 1.16e (7/4/92) by Mike Schwartz & Michael B. Smith
Date: 26 Jul 92 20:47:23 CDT
Organization: Not an Organization

In article <92204.160015GNR100@psuvm.psu.edu> <GNR100@psuvm.psu.edu> writes:
>    I'm having trouble with a whil loop in function I am writing to
> read a line from a fileby puttingeach character into an array, accesed by
> pionters, until the '\n' character is reached of EOF is reached.
>   Trouble is, I keep getting an error message that the function needs an
> Lvalue (address) inside the while loop.  Any ideas as to the problem?
> The filename is a global variable, and that's why it isn't declared.
>
>                 gnr100@psuvm.psu.edu
> ------------------------Begin Code-------------------------------------------
> char readline(char *string[])
> {
>   int i=0;
>
>   while(((*string+i++=(char)getc(fname))!=EOF)
>       &&((*string+i++=(char)getc(fname))!='\n'));
>   return (*string+(i-1));
> }
>

Try adding one more set of parentheses.  You're adding what's in (*string) to the
integer i, thereby producing an integer value.  Then you're trying to assign
a character to it, which won't work since the integer isn't an lvalue.
Try it like this (note the extra parentheses around (string+i++) :

 char readline(char *string[])
 {
   int i=0;

   while(((*(string+i++)=(char)getc(fname))!=EOF)
   		&&((*(string+i++)=(char)getc(fname))!='\n'));
   return (*string+(i-1));
 }

--

======================================================
 Robert Kesterson 	    robertk@taoami.lerctr.org
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.lang.c
Subject: Re: URGENT HELP NEEDED:  crash upon redirection...
Date: 27 Jul 92 18:14:16 GMT
Reply-To: dave@cs.arizona.edu (Dave Schaumann)
Organization: University of Arizona

In article <1992Jul27.041134.15483@ucunix.san.uc.edu>, schectr@ucunix (ROBB SCHECTER) writes:
>Hello everyone; this homework is do Monday at Midnight

>-> I am too inexperienced with C on UNIX (and gcc) to know if I'm doing
>   something obvious, or even where to look for errors.

If the class is over you're head, you're better off talking to the
instructor than getting answers you don't understand from the net.

BTW, if you're using gcc, why not try out gdb?  It's semi-easy to
use, and knowing how to use a debugger is an invaluable asset to
programming.

-- 
There is a fifth dimension beyond that which is known to man. It is a dimension
as vast as space and as timeless as infinity.  It is the middle ground between
light and shadow, between science and superstition. And it lies between the pit
of Man's fears and the summit of his knowledge.  This is the dimension of
imagination -- it is an area which we call "The Twilight Zone".
From: orville%weyrich@tnet.com
Newsgroups: comp.lang.c
Date: 18 Jul 92 13:00 MDT
Subject: Re: Advanced C CLASS ?
Nf-ID: #R:1992Jul15.134530.14088@walter.cr:-1402620328:1992Jul18.090020.753@weyrich.uuc:-458178258:001:2531
Nf-From: tnet.com!orville%weyrich    Jul 18 13:00:00 1992


In article <1992Jul15.134530.14088@walter.cray.com> jaws@cray.com (Jim Wheeler) writes:
>   What would you teach in an Advanced C class?  What would you expect of
> such a class, if you were a student?
>   I have been teaching C for nearly ten years now. Occasionally I am asked
> for an Advanced C class. This has always puzzled me.  I believe that the
> Introduction to C class should cover the full syntax, from identifier
> name sizes and restrictions through structures, unions, bit-fields,
> pointers, pointers to ...  etc. 


I checked my bookshelf -- I have the following books: 

"Advanced C Tips and Techniques" by Anderson and Anderson (Hayden Books:1988).
It covers topics which include:
	The run time environment -- program areas (text, stack, data, heap)
	Arrays and pointers
	Sequence guarantee points
	Right-left rule
	Lvalues
	Fast array transfers
	Passing entire arrays to functions
	Functions with varying arguments
	C debugging techniques
	A Memory object allocator
	The standard C compiler under Unix
	C under Microport System V/AT
	C under SCO XENIX System V
	Microsoft C 5.0 Compiler
	Turbo C

"Advanced C Programming for Displays" by Rochkind (Prentice Hall 1988).
It covers topics like:
	Character Displays
	Windows
	Keyboards
	UNIX and MS-DOS Operating Systems
	Curses

"Advanced UNIX Programming" by Rochkind (Prentice Hall 1985).
It covers topics like:
	Basic file I/O
	Advanced File I/O
	Terminal I/O
	Processes
	Interprocess Communication
	Signals
	Miscellaneous System Calls
	Portability

My conclusion: if you are being asked for an "Advanced C" class, then
focus on some operating-system dependent aspects, or on some aspects that
students seem to have trouble with the first time around, or pick an
area such as user interfaces or interprocess communication, or portability.

"Advanced" classes give the instructor much more latitude about the choice
of topics than introductory classes do. Choose topics that you are
interested and competant in, and which the students are likely to be interested
in.

Best of luck.


orville

--------------------------------------       **********************************
Orville R. Weyrich, Jr.                          Weyrich Computer Consulting
Certified Data Processor                       POB 5782, Scottsdale, AZ 85261
Certified Systems Professional                      Voice: (602) 391-0821
Certified Computer Programmer                Internet: orville%weyrich@tnet.com
--------------------------------------       **********************************
Newsgroups: comp.lang.c
Subject: C Novice Looking For Shareware/Freeware Compiler
From: ngsippel@miavx2.ham.muohio.edu
Date: 29 Jul 92 18:48:12 EDT
Organization: Watch Ren And Stimpy or Else!

Hello,

I am new to this group and to C.   I wish to find a nice, complete, shareware 
or freeware ANSI C compiler for my 386 at home.  Could someone please email
the ftp site and where and which program to get?   Many thanx!

-- 
      .    _  .     _____________ 
      |\_|/__/|    /             \ 
     / / \/ \  \  / Happy! Happy! \      
    /__|O||O|__ \ \   Joy! Joy!   / 
   |/_ \_/\_/ _\ | \  ___________/      
   | | (____) | ||  |/                       
   \/\___/\__/  // _/
   (_/         ||   
    |          ||\   Norman Sippel
     \        //_/   alias Norman "Muddy" Stimpy
      \______//      
     __|| __||       Email: ngsippel@miavx2.ham.muohio.edu
    (____(____)      
          
Newsgroups: comp.lang.c
From: stephen@eggneb.astro.ucla.edu (Stephen Schimpf)
Subject: Re: MEASURE EXEC TIME OF FORTRAN PROGRAMS ?
Organization: UCLA Dept of Astronomy
Distribution: na
Date: 21 Jul 92 18:56:45 PDT

In article <1992Jul21.234925.3095@mnemosyne.cs.du.edu> rchattam@nyx.cs.du.edu (King Chattam) writes:
>Hello everyone,
>  I am using Microsoft FORTRAN on a DOS 5.0 PC. I want to 
>measure the execution time of some of my FORTRAN programs. Does
>anyone have a FORTRAN or FORTRAN callable C function which 
>will answer my question? If such a routine is available 
>in some public domain, the address of it also will suffice.
>Thanks for your help

A couple of years ago our department bought MS FORTRAN 5.0. I clearly 
remember that among the sample code included with this package were some
benchmark programs (double-precision Whetstone, Sieve of Eratosthenes).
If you have these programs, look at them and you will find a function
used to get the execution time.

Stephen
From: KOSU_MATSB@routh.kosufy.lu.se
Newsgroups: comp.lang.c
Subject: Concatenation of MACROS (2'nd round ;-)
Date: 24 Jul 92 12:53:56 GMT
X-Unparsable-Date: Fri, 24 Jul 92 15:01 GMT+02

Concatenation of MACROS (second round ;-).
Being rather frustrated while writing my last question,
i didn't formulate me too well. Any way i want to thank
those who answered my question and reformulate it:

How do i concatenate the VALUES of two MACROS and place it
into a third macro in a STANDARD way.
i.e.
	#define A foo
	#define B xyzzy
	#define C <some expression of A and B resulting in fooxyzzy>

The answers of my first question hinted the ## operator
	#define C A ## B
or
	#define Concat(x,y) x ## y
	#define C Concat(x,y)

and for older preprocessors
	#define C A/**/B

The latter sort of works but a blank is inserted between the values
	C = foo xyzzy
as the specification demands,
and the first solution also sort of works but since the ## operator
concatenates A and B BEFORE the preprocessor expands the macros 
A and B the result is, sadly,
	C = AB

If it is the definition of the ## operator to be applied before any 
macros are expanded i would, from my point of view, call this a 
minor miss in the definition of the preprocessor.

Oh, It may be interesting to know that i use GNU-GCC 2.2.2 and
VAX-C-030  running under VAX/VMS V5.4-1.

		Sincerely/Mats Bergstrvm.
 -----------------------------------  -----------------------------------
 Mats Bergstrvm                       mats.bergstrom@kosufy.lu.se
 Div of Cosmic and Subatomic Physics  kosu_matsb@130.235.92.17
 Department of Physics                ROUTH::KOSU_MATSB (ROUTH::=57412::)
 University of Lund                   Phone: (+46)104767
 SWEDEN.                              Fax:   (+46)104709
 -----------------------------------  -----------------------------------
Newsgroups: comp.lang.c
From: thompson@atlas.socsci.umn.edu (T. Scott Thompson)
Subject: Re: good memory allocation strategies?
Organization: University of Minnesota
Date: Thu, 30 Jul 1992 21:29:57 GMT

tsmith@cs.tamu.edu (Todd M Smith) writes:

>2) How much of a speed penalty does dynamic allocation really impose?

This is clearly very sensitive to the specific application.  The speed
penalty is ~100% on a do-nothing program that simply allocates and
deallocates memory and 0% on a do-nothing program that does nothing at
all.  A program that actually does something with the memory will get
variable mileage, depending on what is done.
 
If you want an empirical example, a program that I ran recently on a
Cray-2 dynamically allocated about 20K records building a fairly
complicated geometrical data structure, did some simple processing of
the structure, then deallocated everything.  I rewrote it to use
static arrays instead and got about a 20% improvement in CPU time.

  -- Scott Thompson
Newsgroups: comp.lang.c
From: mox@vpnet.chi.il.us (William Moxley)
Subject: Checking variables for characters & Copying portions of strings
Organization: Vpnet Public Access
Date: Mon, 27 Jul 1992 15:08:15 GMT

 
Sorry if this question seems to be a bit basic, I'm new at this...
 
I'm adding an editing feature to a little database I wrote.  I need
to be able to see if a certain variable has anything but whitespace
in it.  (So that you can just hit enter past some of the fields
instead of having to retype everything)  How can I do this?  I've
tried strlen and sizeof, but they just tell me how big the string
is defined for.
 
Also, an unrelated question.  How can you copy a portion of a string
into another?  What I want to do is to take a part out of the middle
section of string 1, and put it in the middle section of string 2.
I've looked at strncpy, but I don't know if/how it's possible to
make it start from the middle of a string.
 
Any help will greatly be appreciated.  And if it matters, I'm using
Borland C++ on an IBM compatible machine.
 
                        William Moxley
                        mox@vpnet.chi.il.us
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: good memory allocation strategies?
Date: 22 Jul 92 09:11:55 GMT
Organization: University of Helsinki

tsmith@cs.tamu.edu writes:
>1) Is it reasonable (in general) to ask the user to live with a big
>limit?

I think not, but your mileage may vary.

>2) How much of a speed penalty does dynamic allocation really impose?

Depends.  You need to measure your own system.

One common situation is that you have a lot of allocations for list
nodes etc, all of the same size and type.  In this case a speed hack
that is often mentioned is that you don't really free the nodes when
they are no longer needed, instead you manage a list of available
allocated nodes.  When allocating a new node, you check your list of
free nodes first, and only after that use malloc if necessary.

>3) How serious of a problem can memory fragmentation be on a modern
>workstation?

Personally, I wouldn't worry about it.  Again, your mileage may vary.

--
Lars.Wirzenius@helsinki.fi
Newsgroups: comp.lang.c
From: drice@ponder.csci.unt.edu (Keith Rice)
Subject: Re: About the 'F' in RTFM
Organization: University of North Texas
Distribution: usa
Date: Wed, 29 Jul 1992 05:38:13 GMT

[flame on]

IMO, the discussion on this subject has gone on long enough and should be
discontinued (or continued in another newsgroup).  Let's knock it off and
get back to the purpose of this newsgroup--discussing _C_!

[flame off]

--
***************************************************************************
* D. Keith Rice -- University of North Texas -- drice@ponder.csci.unt.edu *
***************************************************************************
*   "I like people.  I like the concept of people.  People ruin that."    *
*           -- Damon Wayans on "Late Night with David Letterman" 7/23/92  *
***************************************************************************
* Beta Test: To voluntarily entrust one's data, livelihood and sanity to  *
*            hardware or software intended to destroy all three.  In      *
*            earlier days, virgins were selected to beta test volcanoes.  *
***************************************************************************
Newsgroups: comp.lang.c