Changeset ca2d142 in mainline for uspace/srv/net/structures/packet/packet.c
- Timestamp:
- 2010-02-18T10:00:30Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e326edc
- Parents:
- b8da2a3 (diff), 91478aa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/structures/packet/packet.c
rb8da2a3 rca2d142 184 184 } 185 185 186 packet_t pq_add( packet_tfirst, packet_t packet, size_t order, size_t metric ){186 int pq_add( packet_t * first, packet_t packet, size_t order, size_t metric ){ 187 187 packet_t item; 188 188 189 if( ! packet_is_valid( packet )) return NULL;189 if(( ! first ) || ( ! packet_is_valid( packet ))) return EINVAL; 190 190 pq_set_order( packet, order, metric ); 191 if( packet_is_valid( first )){192 item = first;191 if( packet_is_valid( * first )){ 192 item = * first; 193 193 do{ 194 194 if( item->order < order ){ … … 198 198 item->next = packet->packet_id; 199 199 packet->previous = item->packet_id; 200 return first;200 return EOK; 201 201 } 202 202 }else{ … … 205 205 item->previous = packet->packet_id; 206 206 item = pm_find( packet->previous ); 207 if( item ) item->next = packet->packet_id; 208 return item ? first : packet; 207 if( item ){ 208 item->next = packet->packet_id; 209 }else{ 210 * first = packet; 211 } 212 return EOK; 209 213 } 210 214 }while( packet_is_valid( item )); 211 215 } 212 return packet; 216 * first = packet; 217 return EOK; 213 218 } 214 219
Note:
See TracChangeset
for help on using the changeset viewer.