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

Hello David!

21 Oct 98 21:40, David Noon wrote to James Mckenzie:

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

 DN> Hi James,

Ok.

Here is the declaration for the two variables ex and old_ex:

EXPT_DESC ex, old_ex;     /* Experiment description */
This is before the main (int argc, char *argv[])

call to calc_offered_load:

calc_offered_load (&ex);

finally the code at the beginning of calc_offered_load:

void calc_offered_load (EXPT_DESC_PTR expt)
{
  /* Copy of experiment description structure used for offered load
   * calculation */
    EXPT_DESC   ol_ex;
    int     i;
    double  def_off_load, off_load;
    double  avg_ol;
    int     saved_debug_level;
    char    *copyptr;

    if (verbose) fprintf (outfile, "\n*** Calculating offered
load.***\n\n");
    #ifdef DEBUG_SUPPORT
        saved_debug_level = debug_level;
        if (!(debug_level & DEBUG_OFFLD)) debug_level = DEBUG_OFF;
    #endif /* DEBUG_SUPPORT */

/**/ //bcopy ((char *) expt, (char *) &ol_ex, sizeof (EXPT_DESC));
/*original unix code */
//    copyptr = (char *) memcpy (&ol_ex,  expt, sizeof (EXPT_DESC)); /*
code modified for use under DOS/OS2 by original author. Results in a
SYS1808 error */
//    copyptr = (char *) memmove (&ol_ex, expt, sizeof (expt));
/*This "works" except INT variables end up with incorrect values*/
//    if (!copyptr) {
//  fprintf (stderr, "Experiment file copy failed \n");
//  exit (1);
//    }

old_ex = ex;
/*This works with all values as they are in ex*/

James

... They called it Windows cuz Bill won't let 'em call it Gates
--- GoldED/2 2.50+
* Origin: OS/2 Support * Your place for OS/2 information and Files (1:309/63)
SEEN-BY: 396/1 632/0 371 633/210 260 267 270 371 635/506 728 639/252 670/218
@PATH: 309/63 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™.