![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
warning: passing argument 2 of ‘memset’ makes integer from pointer without a casthello Dave,
Thanks for your previous answer. I have few number of warning. some already solved but this can't come out. all are same problem. please see my code. void pt_delete(struct pt_context *pt, struct tcp_connection *c) { u_char key[KEY_BYTES]; /* if the trie is empty, just return */ if (pt->head == NULL) { return; } memset(key, NULL, KEY_BYTES); pt_make_key(key, c); /* call the recursive search and delete function */ if (pt_remove_r(pt, pt->head, key, NULL)) { /* * If we just deleted the last connection record in the trie * then remove the last node so we have a totally empty trie. */ if (pt->n == 1 && (int)(pt->head->con) == CON_REMOVED) { free(pt->head); pt->head = NULL; pt->n = 0; } } } /**********************************/ int pt_find(struct pt_context *pt, struct tcp_connection *c, struct tcp_connection **rc) { u_char key[KEY_BYTES]; struct pt_node *rn; int r; if (pt->head == NULL) { *rc = NULL; return (0); } /* get a key for this connection */ memset(key, NULL, KEY_BYTES); pt_make_key(key, c); rn = NULL; r = pt_search_r(pt->head, key, &rn); *rc = rn->con; return (r); } /********************/ int pt_insert(struct pt_context *pt, struct tcp_connection *c) { struct pt_node *rn = NULL; u_char key1[KEY_BYTES], key2[KEY_BYTES]; int b; if (pt->head == NULL) { /* make a new head node */ pt->head = pt_new(MIN_KEY_BIT -1, NULL, NULL, c); if (pt->head == NULL) { perror("pt_insert(): malloc(): "); return (0); } else { /* increment node counter and return success */ pt->n++; return (1); } } else { memset(key1, NULL, KEY_BYTES); pt_make_key(key1, c); switch (pt_search_r(pt->head, key1, &rn)) { case 0: memset(key2, NULL, KEY_BYTES); pt_make_key(key2, rn->con); /* find the first differing bit, and its value */ rn->bit = diff_bit(key1, key2, &b); if (((b ? rn->r : rn->l) == pt_new(MIN_KEY_BIT - 1, NULL, NULL, c)) == 0) { return (0); } if (((b ? rn->l : rn->r) == pt_new(MIN_KEY_BIT - 1, NULL, NULL, rn->con)) == 0) { free(b ? rn->r : rn->l); return (0); } rn->con = NULL; pt->n += 2; return (1); case 1: return (2); } } return (0); } All are same problem. warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast |
|
#2
|
|||
|
|||
Re: warning: passing argument 2 of ‘memset’ makes integer from pointer without a castQuote:
What is argument 2 of the memset statements that you posted? What is the declared data type of the second parameter of memset? What is NULL? Sigh... Regards, Dave Footnote: Since this is a continuation of your previous post, it is not (that's not) necessary to create a new thread. |
|
#3
|
|||
|
|||
Re: warning: passing argument 2 of ‘memset’ makes integer from pointer without a casthello.
i already solved this problem. this problem was same like before [NULL instate of 0] Thanks for your reply. But why i am not getting out put after compile. Regards Nasim warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast |
|
#4
|
|||
|
|||
Re: warning: passing argument 2 of ‘memset’ makes integer from pointer without a castQuote:
1. SInce I have no way of knowing what you changed, there is no way that I could guess at what your program looks like. 2. I hate to repeat myself, but: Quote:
Maybe you didn't get it, but my question to you is, "What did you expect to happen?" Or are we supposed to guess at that too? Regards, Dave |
|
#5
|
|||
|
|||
Re: warning: passing argument 2 of ‘memset’ makes integer from pointer without a castHello Dave,
i know you are busy guy. Actually using this i want to exhibits the network intrusion detection for defensive technique. it is a port scan detection tool that attempts to identify TCP port scans to open ports across a network segment by using a state transition analysis of TCP session initiation and teardown. Basically this program will capture the TCP packets. when it sees SYN|ACK, it adds the connection to its database using (lpcap and lnet library) which already i install my system. here i will use my IP address and this program will check. Regards Nasim |
|
#6
|
|||
|
|||
Re: warning: passing argument 2 of ‘memset’ makes integer from pointer without a castQuote:
However... Well, I have asked you twice: Quote:
My point here is to try to help you learn to help yourself. If you can't/won't even tell me what you are expecting and how you are invoking the program, I just can't see how. I am out of ideas. I perceive that I am failing, and I don't see any way that I can do any more. I don't know why you choose not to reply to my request. I see you posting at a number of sites on the web. That's OK with me, but so far I haven't seen much effort on your part in trying to learn how to fix your problems. Maybe you can go to whoever it is that wrote the code and ask that person. I won't be responding again. Maybe the other guys on the other sites have more stamina, but I am just about out of steam. I'm sorry, but I'm done. Regards, Dave "Over and out" |
|
#7
|
|||
|
|||
Re: warning: passing argument 2 of ‘memset’ makes integer from pointer without a castHello Dave,
Again thanks for this much help. any how i over come all the problem. now successfully getting actual result. Again many many thanks. Regards Nasim Ahmed Research Student Computer Engineering (Network Security) |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| Pointer Usage in C++: Beginner to Advanced | varunhome | CPP / C++ Forum | 0 | 19-Aug-2005 09:25 |
| [Tutorial] Pointers in C (Part II) | Stack Overflow | C Programming Language | 0 | 27-Apr-2005 17:36 |
| passing arg 1 of `write' makes integer from pointer withouta cast | lung_sen | C Programming Language | 2 | 28-Mar-2005 21:10 |
| My program can run,but warning were display on Vc++ | fwongmc | C Programming Language | 5 | 08-Dec-2004 10:15 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The