Re: [Flightgear-devel] UIUC compile problem

2002-04-04 Thread Erik Hofman

Robert Deters wrote:

>>
> Can some one with MSVC or SGI please try the above?  If it works, I'll
> change it.

After some testing Im confident something like the following should 
indeed work:


uiuc_menu.cpp line 1429:

ALERT: Process [mozilla-bin] pid 13567 killed: process or stack limit 
exceeded
/* call 2D File Reader with file name (CXfabetaf_file) and 
   moz_run_program[36]: 13567 Memory fault(coredump)f
elevator deflections (deArray) and corresponding
alpha (aArray) and delta CZ (CZArray) values and
max number of terms in alpha arrays (nAlphaArray)
and delfection array (nde) */
uiuc_2DdataFileReader(CXfabetaf_file,
 CXfabetaf_aArray[CXfabetaf_index],
 CXfabetaf_betaArray[CXfabetaf_index],
 CXfabetaf_CXArray[CXfabetaf_index],
 CXfabetaf_nAlphaArray[CXfabetaf_index],
 CXfabetaf_nbeta[CXfabetaf_index]);
if (CXfabetaf_first==true)
   {
 if (CXfabetaf_nice == 1)
   {
 CXfabetaf_na_nice = *CXfabetaf_aArray[CXfabetaf_index][1];
 CXfabetaf_nb_nice = CXfabetaf_nbeta[CXfabetaf_index];
 memcpy(CXfabetaf_bArray_nice,
CXfabetaf_betaArray[CXfabetaf_index],
sizeof(CXfabetaf_bArray_nice));
 memcpy(&CXfabetaf_aArray_nice[i+1],
CXfabetaf_aArray[CXfabetaf_index][1],
CXfabetaf_na_nice);
   }
 aeroDragParts -> storeCommands (*command_line);
 CXfabetaf_first=false;
   }
break;


Erik


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] UIUC compile problem

2002-04-03 Thread Jonathan Polley

Erik,

 Worked like a champ.

Jonathan Polley

On Wednesday, April 3, 2002, at 03:05 AM, Erik Hofman wrote:

> Jonathan Polley wrote:
>> I just updated to the newest uiuc_menu.cpp and am still getting the 
>> compile problem, but far fewer instances. MSVC error is:
>> c:\flightgear\src\fdm\uiucmodel\uiuc_menu.cpp() : error C2106: '=' : 
>> left operand must be l-value
>> on the following lines:
>> 1454, 1506, 1558, 1927, 1979, 2031, 2300, 2352, 2404, 2614, 2666, 2718, 
>> 2770, 2822, 3020, 3072, 3124, 3176, 3228, 3438, 3490, 3542, 3594, 3646
>
>
> You could try this one:
> http://www.a1.nl/~ehofman/fgfs/download/uiuc_menu.cpp
>
> Erik
>
>
>
>
> ___
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] UIUC compile problem

2002-04-03 Thread Robert Deters

- Original Message -
From: "Julian Foad" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 03, 2002 1:16 PM
Subject: Re: [Flightgear-devel] UIUC compile problem


> Robert, maybe I'm missing something but it looks to me like you don't need
to do all this copying; you just need to tell the file reader function where
you want it to put the data.  Like this, for example:
>
>   uiuc_2DdataFileReader(Clfarf_file,
> Clfarf_aArray[Clfarf_index],
> Clfarf_rArray[Clfarf_index],
> Clfarf_ClArray[Clfarf_index],
> Clfarf_nAlphaArray[Clfarf_index],
> Clfarf_nr[Clfarf_index]);
>
> instead of
>
>   uiuc_2DdataFileReader(Clfarf_file,
> datafile_xArray,
> datafile_yArray,
> datafile_zArray,
> datafile_nxArray,
> datafile_ny);
>   d_2_to_3(datafile_xArray, Clfarf_aArray, Clfarf_index);
>   d_1_to_2(datafile_yArray, Clfarf_rArray, Clfarf_index);
>   d_2_to_3(datafile_zArray, Clfarf_ClArray, Clfarf_index);
>   i_1_to_2(datafile_nxArray, Clfarf_nAlphaArray, Clfarf_index);
>   Clfarf_nr[Clfarf_index] = datafile_ny;
>
Can some one with MSVC or SGI please try the above?  If it works, I'll
change it.

Rob


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] UIUC compile problem

2002-04-03 Thread Simon Fowler

On Wed, Apr 03, 2002 at 11:15:55AM +0200, Erik Hofman wrote:
> It would be nice to see if the attached test program produces the 
> following output on all supported platforms(This would allow us to 
> improve the speed of the code dramattically by using memcpy instead of 
> for-loops):
> 
> 0   1   2   3   4   5   6   7   8   9
> 
> Erik

> 
> #include 
> #include 
> 
> int main () {
> 
>int a[2][2][5];
>int b[2][5];
>int q;
>   
>for (q=0; q < 10; q++) {
>   a[0][q/5][q%5] = q;
>   a[1][q/5][q%5] = q+100;
>}
> 
>memcpy(b, a[0], sizeof(b));
>for (q=0; q < 10; q++)
>   printf("%i\t", b[q/5][q%5]);
> 
>return 0;
> }

8<---
#include 
#include 

int main(void)
{
char a[2][2][5];
char b[2][5];
char *p;
int index, i, j, k;

index = 0;
for(i = 0; i < 2; i++) {
for(j = 0; j < 2; j++) {
for(k = 0; k < 5; k++) {
a[i][j][k] = k+j;
}
}
}

for(i = 0; i < 2; i++) {
for(j = 0; j < 5; j++) {
b[i][j] = i+j;
}
}

p = &a[0][0][0];
for(index = 0; index < sizeof(a); index++) {
printf("index a: %2d; element: %2d\n", index, *(p + index));
}
p = &b[0][0];
for(index = 0; index < sizeof(b); index++) {
printf("index b: %2d; element: %2d\n", index, *(p + index));
}
return 0;
}
8<---

Compiled with both gcc and g++, this shows a to be two copies of b
arranged contiguously in memory, which would suggest that you can
indeed use memcpy the way you outlined . . .

Looking at my copy of K&R I think that's funamentally how C handles
multidimensional arrays: from the right, each successive subscript
declares an array of n times the size of the array declared so far,
and when accessing an element, each subscript is multiplied by the
size of the array to the right of it and then added to the index
into the area of memory . . . Which isn't very coherent. The perils
of posting well past one's bedtime ;-) Still, I think it's
definitely safe to use memcpy this way . . .

So, memcpy away ;-)

Simon

-- 
PGP public key Id 0x144A991C, or ftp://bg77.anu.edu.au/pub/himi/himi.asc
(crappy) Homepage: http://bg77.anu.edu.au
doe #237 (see http://www.lemuria.org/DeCSS) 
My DeCSS mirror: ftp://bg77.anu.edu.au/pub/mirrors/css/ 



msg04826/pgp0.pgp
Description: PGP signature


Re: [Flightgear-devel] UIUC compile problem

2002-04-03 Thread Erik Hofman

Jonathan Polley wrote:
> I just updated to the newest uiuc_menu.cpp and am still getting the 
> compile problem, but far fewer instances. MSVC error is:
> 
> c:\flightgear\src\fdm\uiucmodel\uiuc_menu.cpp() : error C2106: '=' : 
> left operand must be l-value
> 
> 
> on the following lines:
> 
> 1454, 1506, 1558, 1927, 1979, 2031, 2300, 2352, 2404, 2614, 2666, 2718, 
> 2770, 2822, 3020, 3072, 3124, 3176, 3228, 3438, 3490, 3542, 3594, 3646

It would be nice to see if the attached test program produces the 
following output on all supported platforms(This would allow us to 
improve the speed of the code dramattically by using memcpy instead of 
for-loops):

0   1   2   3   4   5   6   7   8   9

Erik



#include 
#include 

int main () {

   int a[2][2][5];
   int b[2][5];
   int q;
  
   for (q=0; q < 10; q++) {
  a[0][q/5][q%5] = q;
  a[1][q/5][q%5] = q+100;
   }

   memcpy(b, a[0], sizeof(b));
   for (q=0; q < 10; q++)
  printf("%i\t", b[q/5][q%5]);

   return 0;
}



Re: [Flightgear-devel] UIUC compile problem

2002-04-03 Thread Erik Hofman

Jonathan Polley wrote:
> I just updated to the newest uiuc_menu.cpp and am still getting the 
> compile problem, but far fewer instances. MSVC error is:
> 
> c:\flightgear\src\fdm\uiucmodel\uiuc_menu.cpp() : error C2106: '=' : 
> left operand must be l-value
> 
> 
> on the following lines:
> 
> 1454, 1506, 1558, 1927, 1979, 2031, 2300, 2352, 2404, 2614, 2666, 2718, 
> 2770, 2822, 3020, 3072, 3124, 3176, 3228, 3438, 3490, 3542, 3594, 3646


You could try this one:
http://www.a1.nl/~ehofman/fgfs/download/uiuc_menu.cpp

Erik




___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



[Flightgear-devel] UIUC compile problem

2002-04-02 Thread Jonathan Polley
I just updated to the newest uiuc_menu.cpp and am still getting the compile problem, but far fewer instances.  MSVC error is:

c:\flightgear\src\fdm\uiucmodel\uiuc_menu.cpp() : error C2106: '=' : left operand must be l-value


on the following lines:

1454, 1506, 1558, 1927, 1979, 2031, 2300, 2352, 2404, 2614, 2666, 2718, 2770, 2822, 3020, 3072, 3124, 3176, 3228, 3438, 3490, 3542, 3594, 3646



Thanks!

Jonathan Polley


Re: [Flightgear-devel] UIUC compile problem

2002-04-02 Thread Martin Spott

> From: "Erik Hofman" <[EMAIL PROTECTED]>

>> When trying to compile the latest UIUC code I got the following error
>> for about a hundred times:
[...]

> What are you using to compile it?  It compiles fine with gcc version 2.96
> under Redhat 7.1.

Erik an I are the ones that form the "SGI group" in this project. Erik's
doing the work and I benefit from him dealing with portability issues  ;-)

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] UIUC compile problem

2002-04-02 Thread jacco

So Robert Deters says:
>> BTW, what *is* the intention of the code, assigning pointers, copying
>> one entry, or copying the complete table?
>>
>> Erik
> 
> The purpose is to copy the complete table.  What I have in uiuc_menu
> is just a short cut instead of writing a bunch of for loops to copy
> multiple dimension arrays.  But since it looks like this doesn't work
> for all compilers, I guess I be writing some for loops.
> 
> Rob

Can you do a memcpy(), or isn't that supported on all architectures?

Groeten,- Jacco

--
Think about it:   | In Real Life: Jacco van Schaik
If the wheel had never been   | Mail me at:   [EMAIL PROTECTED]
reinvented, we'd still be | Spam bait:postmaster@localhost
driving on logs...| See also http://www.frontier.nl/



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] UIUC compile problem

2002-04-02 Thread Robert Deters


- Original Message -
From: "Erik Hofman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 02, 2002 1:53 PM
Subject: Re: [Flightgear-devel] UIUC compile problem


> Robert Deters wrote:
>
> >>
> >>Does anybody have any idea of how to solve this??
> >>
> >>Erik
> >>
> >>
> > What are you using to compile it?  It compiles fine with gcc version
2.96
> > under Redhat 7.1.
>
> If i change uiuc_menu.cpp (line 1412)
>
> CXfabetaf_aArray[CXfabetaf_index]  = datafile_xArray;
> CXfabetaf_betaArray[CXfabetaf_index]   = datafile_yArray;
> CXfabetaf_CXArray[CXfabetaf_index] = datafile_zArray;
> CXfabetaf_nAlphaArray[CXfabetaf_index] = datafile_nxArray;
> CXfabetaf_nbeta[CXfabetaf_index]   = datafile_ny;
>
> to:
>
> CXfabetaf_aArray[CXfabetaf_index][0][0]   = datafile_xArray[0][0];
> CXfabetaf_betaArray[CXfabetaf_index][0]   = datafile_yArray[0];
> CXfabetaf_CXArray[CXfabetaf_index][0][0]  = datafile_zArray[0][0];
> CXfabetaf_nAlphaArray[CXfabetaf_index][0] = datafile_nxArray[0];
> CXfabetaf_nbeta[CXfabetaf_index]  = datafile_ny;
>
> it works, but I doubt this is th intention of the code.
> :-(
>
> BTW, what *is* the intention of the code, assigning pointers, copying
> one entry, or copying the complete table?
>
> Erik

The purpose is to copy the complete table.  What I have in uiuc_menu is just
a short cut instead of writing a bunch of for loops to copy multiple
dimension arrays.  But since it looks like this doesn't work for all
compilers, I guess I be writing some for loops.

Rob


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] UIUC compile problem

2002-04-02 Thread Erik Hofman

Robert Deters wrote:

>>
>>Does anybody have any idea of how to solve this??
>>
>>Erik
>>
>>
> What are you using to compile it?  It compiles fine with gcc version 2.96
> under Redhat 7.1.

If i change uiuc_menu.cpp (line 1412)

CXfabetaf_aArray[CXfabetaf_index]  = datafile_xArray;
CXfabetaf_betaArray[CXfabetaf_index]   = datafile_yArray;
CXfabetaf_CXArray[CXfabetaf_index] = datafile_zArray;
CXfabetaf_nAlphaArray[CXfabetaf_index] = datafile_nxArray;
CXfabetaf_nbeta[CXfabetaf_index]   = datafile_ny;

to:

CXfabetaf_aArray[CXfabetaf_index][0][0]   = datafile_xArray[0][0];
CXfabetaf_betaArray[CXfabetaf_index][0]   = datafile_yArray[0];
CXfabetaf_CXArray[CXfabetaf_index][0][0]  = datafile_zArray[0][0];
CXfabetaf_nAlphaArray[CXfabetaf_index][0] = datafile_nxArray[0];
CXfabetaf_nbeta[CXfabetaf_index]  = datafile_ny;

it works, but I doubt this is th intention of the code.
:-(

BTW, what *is* the intention of the code, assigning pointers, copying 
one entry, or copying the complete table?

Erik


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] UIUC compile problem

2002-04-02 Thread Robert Deters

- Original Message -
From: "Erik Hofman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 02, 2002 6:45 AM
Subject: [Flightgear-devel] UIUC compile problem


> Hi,
>
> When trying to compile the latest UIUC code I got the following error
> for about a hundred times:
>
> "../../../../src/FDM/UIUCModel/uiuc_menu.cpp", line 3399: error(1133):
>  expression must be a modifiable lvalue
> Cnfabetaf_nAlphaArray[Cnfabetaf_index] = datafile_nxArray;
>
> It seems like the compile can't hanle the following:
>
> int x[10][100];
> int y[100];
>
> x[0] = y;
> ...
>
>
> Does anybody have any idea of how to solve this??
>
> Erik
>
What are you using to compile it?  It compiles fine with gcc version 2.96
under Redhat 7.1.

Rob


>
>
> ___
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel
>


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



[Flightgear-devel] UIUC compile problem

2002-04-02 Thread Erik Hofman

Hi,

When trying to compile the latest UIUC code I got the following error 
for about a hundred times:

"../../../../src/FDM/UIUCModel/uiuc_menu.cpp", line 3399: error(1133):
 expression must be a modifiable lvalue
Cnfabetaf_nAlphaArray[Cnfabetaf_index] = datafile_nxArray;

It seems like the compile can't hanle the following:

int x[10][100];
int y[100];

x[0] = y;
...


Does anybody have any idea of how to solve this??

Erik



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel