Commit 6f5d5845 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Don't perform pointer arithmetic on void pointers, patch by Tai Chi Minh

2008-07-02  Jürg Billeter  <j@bitron.ch>

	* gobject/valaccodegeneratorsourcefile.vala:

	Don't perform pointer arithmetic on void pointers,
	patch by Tai Chi Minh Ralph Eastwood

svn path=/trunk/; revision=1671
parent b85b894b
2008-07-02 Jürg Billeter <j@bitron.ch>
* gobject/valaccodegeneratorsourcefile.vala:
Don't perform pointer arithmetic on void pointers,
patch by Tai Chi Minh Ralph Eastwood
2008-07-02 Jürg Billeter <j@bitron.ch>
* vapi/packages/gio-2.0/:
......
......@@ -46,6 +46,7 @@ Roland Hostettler
Ross Burton
Samuel Cormier-Iijima
Stéphan Kochen
Tai Chi Minh Ralph Eastwood
Thijs Vermeir
Travis Watkins
Vlad Grecescu
......
......@@ -100,7 +100,7 @@ public class Vala.CCodeGenerator {
fun.add_parameter (new CCodeFormalParameter ("length", "gint"));
source_type_member_declaration.append (fun.copy ());
var array = new CCodeIdentifier ("array");
var array = new CCodeCastExpression (new CCodeIdentifier ("array"), "char*");
var element_size = new CCodeIdentifier ("element_size");
var length = new CCodeIdentifier ("length");
var src = new CCodeIdentifier ("src");
......@@ -118,14 +118,14 @@ public class Vala.CCodeGenerator {
fun.block.add_statement (new CCodeExpressionStatement (ccall));
var czero1 = new CCodeFunctionCall (new CCodeIdentifier ("memset"));
czero1.add_argument (new CCodeCastExpression (src_address, "char *"));
czero1.add_argument (src_address);
czero1.add_argument (new CCodeConstant ("0"));
czero1.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.MUL, new CCodeParenthesizedExpression (new CCodeBinaryExpression (CCodeBinaryOperator.MINUS, dest, src)), element_size));
var czeroblock1 = new CCodeBlock ();
czeroblock1.add_statement (new CCodeExpressionStatement (czero1));
var czero2 = new CCodeFunctionCall (new CCodeIdentifier ("memset"));
czero2.add_argument (new CCodeCastExpression (dest_end_address, "char *"));
czero2.add_argument (dest_end_address);
czero2.add_argument (new CCodeConstant ("0"));
czero2.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.MUL, new CCodeParenthesizedExpression (new CCodeBinaryExpression (CCodeBinaryOperator.MINUS, src, dest)), element_size));
var czeroblock2 = new CCodeBlock ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment