vte r2180 - in trunk: . src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: vte r2180 - in trunk: . src
- Date: Sat, 22 Nov 2008 13:54:36 +0000 (UTC)
Author: chpe
Date: Sat Nov 22 13:54:36 2008
New Revision: 2180
URL: http://svn.gnome.org/viewvc/vte?rev=2180&view=rev
Log:
Bug 536894 â Confusing use of "free" as variable-name in ring
functions
* src/ring.c: (_vte_ring_new), (_vte_ring_new_with_delta),
(_vte_ring_remove):
* src/ring.h: Don't shadow global declarations. Patch by dmacks at
netspace.org.
Modified:
trunk/ChangeLog
trunk/src/ring.c
trunk/src/ring.h
Modified: trunk/src/ring.c
==============================================================================
--- trunk/src/ring.c (original)
+++ trunk/src/ring.c Sat Nov 22 13:54:36 2008
@@ -43,7 +43,7 @@
/**
* _vte_ring_new:
* @max_elements: the maximum size the new ring will be allowed to reach
- * @free: a #VteRingFreeFunc
+ * @free_func: a #VteRingFreeFunc
* @data: user data for @free
*
* Allocates a new ring capable of holding up to @max_elements elements at a
@@ -53,23 +53,23 @@
* Returns: a new ring
*/
VteRing *
-_vte_ring_new(glong max_elements, VteRingFreeFunc free, gpointer data)
+_vte_ring_new(glong max_elements, VteRingFreeFunc free_func, gpointer data)
{
VteRing *ret = g_slice_new0(VteRing);
ret->user_data = data;
ret->cached_item = -1;
ret->max = MAX(max_elements, 2);
ret->array = g_malloc0(sizeof(gpointer) * ret->max);
- ret->free = free;
+ ret->free = free_func;
return ret;
}
VteRing *
_vte_ring_new_with_delta(glong max_elements, glong delta,
- VteRingFreeFunc free, gpointer data)
+ VteRingFreeFunc free_func, gpointer data)
{
VteRing *ret;
- ret = _vte_ring_new(max_elements, free, data);
+ ret = _vte_ring_new(max_elements, free_func, data);
ret->delta = delta;
return ret;
}
@@ -244,7 +244,7 @@
*
*/
gpointer
-_vte_ring_remove(VteRing * ring, long position, gboolean free)
+_vte_ring_remove(VteRing * ring, long position, gboolean free_element)
{
long i;
gpointer old_data;
@@ -261,7 +261,7 @@
i = position % ring->max;
/* Remove the data at this position. */
old_data = ring->array[i];
- if (free && old_data && ring->free) {
+ if (free_element && old_data && ring->free) {
_vte_debug_print(VTE_DEBUG_RING,
"Freeing item at position %ld.\n", position);
ring->free(old_data, ring->user_data);
Modified: trunk/src/ring.h
==============================================================================
--- trunk/src/ring.h (original)
+++ trunk/src/ring.h Sat Nov 22 13:54:36 2008
@@ -67,10 +67,10 @@
(__cast) _vte_ring_at(__ring, __position)
VteRing *_vte_ring_new(glong max_elements,
- VteRingFreeFunc free,
+ VteRingFreeFunc free_func,
gpointer data);
VteRing *_vte_ring_new_with_delta(glong max_elements, glong delta,
- VteRingFreeFunc free, gpointer data);
+ VteRingFreeFunc free_func, gpointer data);
gpointer _vte_ring_insert(VteRing *ring, glong position, gpointer data);
gpointer _vte_ring_insert_preserve(VteRing *ring, glong position, gpointer data);
gpointer _vte_ring_remove(VteRing *ring, glong position, gboolean free_element);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]