Menu

#3 glib2.pas: g_array_append_val

open
nobody
None
5
2006-02-12
2006-02-12
angustia
No

glib2.pas line 221:
function g_array_append_val(a: PGArray; v : gpointer) :
PGArray;
begin
g_array_append_val := g_array_append_vals(a,@(v),1);
end;

function g_array_prepend_val(a: PGArray; v : gpointer)
: PGArray;
begin
g_array_prepend_val := g_array_prepend_vals(a,@(v),1);
end;

function g_array_insert_val(a: PGArray; i: guint; v :
gpointer) : PGArray;
begin
g_array_insert_val := g_array_insert_vals(a,i,@(v),1);
end;

i see g_array_append_vals is receiving "@(v)", that
means a pointer to the pointer, when it must receive
the pointer.

i noticed that when i was writting a small program and
having weird effects because the GArray seems not being
storing the data i gave it. so i change those lines to
these:

function g_array_append_val(a: PGArray; v : gpointer) :
PGArray;
begin
g_array_append_val := g_array_append_vals(a,
gconstpointer(v), 1);
end;

function g_array_prepend_val(a: PGArray; v : gpointer)
: PGArray;
begin
g_array_prepend_val := g_array_prepend_vals(a,
gconstpointer(v), 1);
end;

function g_array_insert_val(a: PGArray; i: guint; v :
gpointer) : PGArray;
begin
g_array_insert_val := g_array_insert_vals(a,i,
gconstpointer(v), 1);
end;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.