Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/hbuf.c @ 502:3134b4960cdb
Fix mixed declaration and code
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 30 Oct 2005 12:09:32 +0200 |
parents | e4840b288be0 |
children | 8b3db0b555a1 |
comparison
equal
deleted
inserted
replaced
501:7c1ca00070e8 | 502:3134b4960cdb |
---|---|
65 hbuf_block_elt->ptr = g_new(char, HBB_BLOCKSIZE); | 65 hbuf_block_elt->ptr = g_new(char, HBB_BLOCKSIZE); |
66 hbuf_block_elt->flags = HBB_FLAG_ALLOC | HBB_FLAG_PERSISTENT; | 66 hbuf_block_elt->flags = HBB_FLAG_ALLOC | HBB_FLAG_PERSISTENT; |
67 hbuf_block_elt->ptr_end_alloc = hbuf_block_elt->ptr + HBB_BLOCKSIZE; | 67 hbuf_block_elt->ptr_end_alloc = hbuf_block_elt->ptr + HBB_BLOCKSIZE; |
68 *p_hbuf = g_list_append(*p_hbuf, hbuf_block_elt); | 68 *p_hbuf = g_list_append(*p_hbuf, hbuf_block_elt); |
69 } else { | 69 } else { |
70 hbuf_block *hbuf_b_prev; | |
70 // Set p_hbuf to the end of the list, to speed up history loading | 71 // Set p_hbuf to the end of the list, to speed up history loading |
71 // (or CPU time will be used by g_list_last() for each line) | 72 // (or CPU time will be used by g_list_last() for each line) |
72 hbuf = *p_hbuf = g_list_last(*p_hbuf); | 73 hbuf = *p_hbuf = g_list_last(*p_hbuf); |
73 hbuf_block *hbuf_b_prev = hbuf->data; | 74 hbuf_b_prev = hbuf->data; |
74 hbuf_block_elt->ptr = hbuf_b_prev->ptr_end; | 75 hbuf_block_elt->ptr = hbuf_b_prev->ptr_end; |
75 hbuf_block_elt->flags = HBB_FLAG_PERSISTENT; | 76 hbuf_block_elt->flags = HBB_FLAG_PERSISTENT; |
76 hbuf_block_elt->ptr_end_alloc = hbuf_b_prev->ptr_end_alloc; | 77 hbuf_block_elt->ptr_end_alloc = hbuf_b_prev->ptr_end_alloc; |
77 g_list_append(*p_hbuf, hbuf_block_elt); | 78 g_list_append(*p_hbuf, hbuf_block_elt); |
78 } | 79 } |