Re: malloc to arrays?

2000-08-03 Thread Aleksandr A.Babaylov
Chris Costello writes: On Wednesday, August 02, 2000, Mike Smith wrote: tcpcash_addr = (typeof(tcpcash_addr)) malloc(sizeof(*tcpcash_addr) * TCPCASH_ROWSIZE * TCPCASH_COOLSIZE); Just as a note on coding

Re: malloc to arrays?

2000-08-03 Thread Chris BeHanna
On Fri, 4 Aug 2000, Aleksandr A.Babaylov wrote: Chris Costello writes: On Wednesday, August 02, 2000, Mike Smith wrote: tcpcash_addr = (typeof(tcpcash_addr)) malloc(sizeof(*tcpcash_addr) * TCPCASH_ROWSIZE *

Re: malloc to arrays?

2000-08-02 Thread .
Chris Costello wrote: On Wednesday, August 02, 2000, [EMAIL PROTECTED] wrote: Sorry I have no other direction to ask this: I have declaration: u_int32_t *(tcpcash_addr[256]); and want malloc some memory for tcpcash_addr: tcpcash_addr =

Re: malloc to arrays?

2000-08-02 Thread Mike Smith
Yes, and whan I use u_int32_t *(tcpcash_addr[256]) declaration, I can use tcpcash_addr[x][y], and I must use tcpcash_addr[x * 256 + y] if declaration is u_int32_t *tcphash_haddr, I cant use if u_int32_t **tcphash_haddr, because of need of array of pointers in addition to array of arrays,

Re: malloc to arrays?

2000-08-02 Thread Mike Smith
It's only "clear" insofar as it's "clear" that the code is terrible. Coffee first, critique second. 8) #define TCPCASH_ROWSIZE 256 #define TCPCASH_COLSIZE 256 #define TCPCASH_ADDR(x) ((x) * TCPCASH_ROWSIZE) #define TCPCASH_ADDR(x,y) ((y) * TCPCASH_ROWSIZE + (x)) --

Re: malloc to arrays?

2000-08-02 Thread .
[Charset iso-8859-1 unsupported, filtering to ASCII...] It's only "clear" insofar as it's "clear" that the code is terrible. Sorry I know English bad, do you want to say that my code is terrible? Coffee first, critique second. 8) #define TCPCASH_ROWSIZE 256 #define TCPCASH_COLSIZE

Re: malloc to arrays?

2000-08-02 Thread Chris Costello
On Wednesday, August 02, 2000, Mike Smith wrote: tcpcash_addr = (typeof(tcpcash_addr)) malloc(sizeof(*tcpcash_addr) * TCPCASH_ROWSIZE * TCPCASH_COOLSIZE); Just as a note on coding style, this will

malloc to arrays?

2000-08-01 Thread .
Sorry I have no other direction to ask this: I have declaration: u_int32_t *(tcpcash_addr[256]); and want malloc some memory for tcpcash_addr: tcpcash_addr = (typeof(tcpcash_addr))malloc(u_int32_t * 256 * n); and have an error: ra-sum.c:386: cast specifies array type *** Error code 1 How

Re: malloc to arrays?

2000-08-01 Thread Chris Costello
On Wednesday, August 02, 2000, [EMAIL PROTECTED] wrote: Sorry I have no other direction to ask this: I have declaration: u_int32_t *(tcpcash_addr[256]); and want malloc some memory for tcpcash_addr: tcpcash_addr = (typeof(tcpcash_addr))malloc(u_int32_t * 256 * n); and have an error:

Re: malloc to arrays?

2000-08-01 Thread Daniel C. Sobral
Chris Costello wrote: On Wednesday, August 02, 2000, [EMAIL PROTECTED] wrote: Sorry I have no other direction to ask this: I have declaration: u_int32_t *(tcpcash_addr[256]); and want malloc some memory for tcpcash_addr: tcpcash_addr = (typeof(tcpcash_addr))malloc(u_int32_t *