TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: James Mckenzie
from: David Noon
date: 1998-10-21 21:40:10
subject: Need to copy

In a message dated 10-19-98, James Mckenzie said to Mario Semo about "Need
to copy"

Hi James,

JM>Believe it or not this works:

JM>Void calc_offered_load (EXPT_DESC_PTR expt)
JM>{
JM>EXPT_DESC  ol_ex;

JM>old_ex = ex;

What is 'old_ex'?

What happened to 'expt'?

Where is 'ex' declared and as what?

If that's a typo and you meant

  ol_ex = expt;

then this is semantically incorrect, as you should dereference the pointer.

[I get the impression you typed the code in by hand rather than cut and
pasted it from a text editor displaying your code.]

JM>where
JM>memmove (&ol_ex , expt, sizeof(EXPT_DESC);

JM>does not, as improper values result from some of the internal variables.

JM>and memcpy (....);

JM>results in a SYS1808 when called.

JM>And I'm wondering why.

How about complete code for calc_offered_load? [And its caller.]

First thing is to check that you don't have a declaration of:

      EXPT_DESC  * ol_ex;

The asterisk would change the rules completely.

Regards

Dave

___
 * MR/2 2.25 #353 * Radioactive halibut will make fission chips.

--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-717904) (2:440/4)
SEEN-BY: 396/1 632/0 371 633/210 260 267 270 371 635/506 728 639/252 670/218
@PATH: 440/4 255/1 251/25 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.