Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
Vincent, I will add the NEWS and ChangeLog before I leave the office today. I did not do it now because more fixes are coming. Dh -Original Message- From: Enlightenment SVN [mailto:no-re...@enlightenment.org] Sent: 21 September 2012 09:18 AM To: enlightenment-...@lists.sourceforge.net Subject: E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib Log: Ecore_X: Fix more randr functions. Properly return output Modes from ecore_x_randr_output_modes_get (more memcpy madness). Author: devilhorns Date: 2012-09-21 01:17:35 -0700 (Fri, 21 Sep 2012) New Revision: 76940 Trac: http://trac.enlightenment.org/e/changeset/76940 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c 2012-09-21 08:16:50 UTC (rev 76939) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c 2012-09-21 08:17:35 UTC (rev 76940) @@ -1590,13 +1590,13 @@ { if ((modes = malloc(sizeof(Ecore_X_Randr_Mode) * output_info-nmode))) { - memcpy(modes, output_info-modes, -(sizeof(Ecore_X_Randr_Mode) * output_info-nmode)); - if (num) - *num = output_info-nmode; + int i = 0; - if (npreferred) - *npreferred = output_info-npreferred; + if (num) *num = output_info-nmode; + if (npreferred) *npreferred = output_info-npreferred; + + for (i = 0; i output_info-nmode; i++) + modes[i] = output_info-modes[i]; } } -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-svn mailing list enlightenment-...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-svn -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
you know what you have forgotten, right ? Vincent On Mon, Sep 10, 2012 at 12:46 PM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: Ecore_X (randr): Correctly list crtcs also (same fix as outputs). Author: devilhorns Date: 2012-09-10 03:46:07 -0700 (Mon, 10 Sep 2012) New Revision: 76392 Trac: http://trac.enlightenment.org/e/changeset/76392 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c 2012-09-10 10:41:25 UTC (rev 76391) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c 2012-09-10 10:46:07 UTC (rev 76392) @@ -532,8 +532,12 @@ { if ((ret = malloc(sizeof(Ecore_X_Randr_Crtc) * res-ncrtc))) { - memcpy(ret, res-crtcs, (sizeof(Ecore_X_Randr_Crtc) * res-ncrtc)); - *num = res-ncrtc; + int i = 0; + + if (num) *num = res-ncrtc; + + for (i = 0; i res-ncrtc; i++) + ret[i] = res-crtcs[i]; } XRRFreeScreenResources(res); -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-svn mailing list enlightenment-...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-svn -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
Ahhh indeed. You caught me sleeping !! ;) Thanks for the heads up :) dh On 10/09/12 13:05, Vincent Torri wrote: you know what you have forgotten, right ? Vincent On Mon, Sep 10, 2012 at 12:46 PM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: Ecore_X (randr): Correctly list crtcs also (same fix as outputs). Author: devilhorns Date: 2012-09-10 03:46:07 -0700 (Mon, 10 Sep 2012) New Revision: 76392 Trac: http://trac.enlightenment.org/e/changeset/76392 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c 2012-09-10 10:41:25 UTC (rev 76391) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c 2012-09-10 10:46:07 UTC (rev 76392) @@ -532,8 +532,12 @@ { if ((ret = malloc(sizeof(Ecore_X_Randr_Crtc) * res-ncrtc))) { - memcpy(ret, res-crtcs, (sizeof(Ecore_X_Randr_Crtc) * res-ncrtc)); - *num = res-ncrtc; + int i = 0; + + if (num) *num = res-ncrtc; + + for (i = 0; i res-ncrtc; i++) + ret[i] = res-crtcs[i]; } XRRFreeScreenResources(res); -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On Fri, 11 Nov 2011, Enlightenment SVN wrote: Log: Ecore_X: If malloc fails (when trying to get a window property list), then return -1 to indicate failure. Add some missing parens in the formatting. Author: devilhorns Date: 2011-11-11 11:11:35 -0800 (Fri, 11 Nov 2011) New Revision: 65074 Trac: http://trac.enlightenment.org/e/changeset/65074 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c2011-11-11 18:51:53 UTC (rev 65073) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c2011-11-11 19:11:35 UTC (rev 65074) @@ -118,13 +118,18 @@ bytes_after, prop_ret) != Success) return -1; - if (type_ret != XA_CARDINAL || format_ret != 32) + if ((type_ret != XA_CARDINAL) || (format_ret != 32)) num = -1; - else if (num_ret == 0 || !prop_ret) + else if ((num_ret == 0) || (!prop_ret)) num = 0; else { val = malloc(num_ret * sizeof(unsigned int)); +if (!val) + { + if (prop_ret) XFree(prop_ret); + return -1; + } for (i = 0; i num_ret; i++) val[i] = ((unsigned long *)prop_ret)[i]; val is an array of unsigned int. Problem on 64 bits if you use long Vincent num = num_ret; -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-svn mailing list enlightenment-...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-svn -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On 11/11/11 14:13, Vincent Torri wrote: On Fri, 11 Nov 2011, Enlightenment SVN wrote: Log: Ecore_X: If malloc fails (when trying to get a window property list), then return -1 to indicate failure. Add some missing parens in the formatting. Author: devilhorns Date: 2011-11-11 11:11:35 -0800 (Fri, 11 Nov 2011) New Revision: 65074 Trac: http://trac.enlightenment.org/e/changeset/65074 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 18:51:53 UTC (rev 65073) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 19:11:35 UTC (rev 65074) @@ -118,13 +118,18 @@ bytes_after,prop_ret) != Success) return -1; - if (type_ret != XA_CARDINAL || format_ret != 32) + if ((type_ret != XA_CARDINAL) || (format_ret != 32)) num = -1; - else if (num_ret == 0 || !prop_ret) + else if ((num_ret == 0) || (!prop_ret)) num = 0; else { val = malloc(num_ret * sizeof(unsigned int)); +if (!val) + { + if (prop_ret) XFree(prop_ret); + return -1; + } for (i = 0; i num_ret; i++) val[i] = ((unsigned long *)prop_ret)[i]; val is an array of unsigned int. Problem on 64 bits if you use long Vincent Indeed :) As stated in a different email, I have no problems w/ the patch..good catch :) dh num = num_ret; -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On 11/11/11 14:27, Christopher Michael wrote: On 11/11/11 14:13, Vincent Torri wrote: On Fri, 11 Nov 2011, Enlightenment SVN wrote: Log: Ecore_X: If malloc fails (when trying to get a window property list), then return -1 to indicate failure. Add some missing parens in the formatting. Author: devilhorns Date: 2011-11-11 11:11:35 -0800 (Fri, 11 Nov 2011) New Revision: 65074 Trac: http://trac.enlightenment.org/e/changeset/65074 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 18:51:53 UTC (rev 65073) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 19:11:35 UTC (rev 65074) @@ -118,13 +118,18 @@ bytes_after,prop_ret) != Success) return -1; - if (type_ret != XA_CARDINAL || format_ret != 32) + if ((type_ret != XA_CARDINAL) || (format_ret != 32)) num = -1; - else if (num_ret == 0 || !prop_ret) + else if ((num_ret == 0) || (!prop_ret)) num = 0; else { val = malloc(num_ret * sizeof(unsigned int)); +if (!val) + { + if (prop_ret) XFree(prop_ret); + return -1; + } for (i = 0; i num_ret; i++) val[i] = ((unsigned long *)prop_ret)[i]; val is an array of unsigned int. Problem on 64 bits if you use long Vincent Indeed :) As stated in a different email, I have no problems w/ the patch..good catch :) dh Sorry, wrong reply. I see what you meant now. Fixed in svn ;) dh num = num_ret; -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On Fri, 11 Nov 2011 20:43:04 +0100, Enlightenment SVN no-re...@enlightenment.org wrote: Log: Ecore_X: Fix array problem for 64-bit (unsigned long vs unsigned int). Thanks vtorri ;) Author: devilhorns Date: 2011-11-11 11:43:04 -0800 (Fri, 11 Nov 2011) New Revision: 65076 Trac: http://trac.enlightenment.org/e/changeset/65076 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c2011-11-11 19:12:36 UTC (rev 65075) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c2011-11-11 19:43:04 UTC (rev 65076) @@ -131,7 +131,7 @@ return -1; } for (i = 0; i num_ret; i++) - val[i] = ((unsigned long *)prop_ret)[i]; + val[i] = ((unsigned int *)prop_ret)[i]; num = num_ret; *plst = val; } This fix is incorrect - man XGetWindowProperty. ... and if it weren't there are four more occurrences of ((unsigned long *)prop_ret)[i] in the file. /Kim -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On Fri, 11 Nov 2011, Kim Woelders wrote: On Fri, 11 Nov 2011 20:43:04 +0100, Enlightenment SVN no-re...@enlightenment.org wrote: Log: Ecore_X: Fix array problem for 64-bit (unsigned long vs unsigned int). Thanks vtorri ;) Author: devilhorns Date: 2011-11-11 11:43:04 -0800 (Fri, 11 Nov 2011) New Revision: 65076 Trac: http://trac.enlightenment.org/e/changeset/65076 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 19:12:36 UTC (rev 65075) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 19:43:04 UTC (rev 65076) @@ -131,7 +131,7 @@ return -1; } for (i = 0; i num_ret; i++) - val[i] = ((unsigned long *)prop_ret)[i]; + val[i] = ((unsigned int *)prop_ret)[i]; num = num_ret; *plst = val; } This fix is incorrect - man XGetWindowProperty. then val is wrong Vincent ... and if it weren't there are four more occurrences of ((unsigned long *)prop_ret)[i] in the file. /Kim -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On Fri, 11 Nov 2011 22:23:35 +0100 (CET) Vincent Torri vto...@univ-evry.fr said: On Fri, 11 Nov 2011, Kim Woelders wrote: On Fri, 11 Nov 2011 20:43:04 +0100, Enlightenment SVN no-re...@enlightenment.org wrote: Log: Ecore_X: Fix array problem for 64-bit (unsigned long vs unsigned int). Thanks vtorri ;) Author: devilhorns Date: 2011-11-11 11:43:04 -0800 (Fri, 11 Nov 2011) New Revision: 65076 Trac: http://trac.enlightenment.org/e/changeset/65076 Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c Modified: trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c === --- trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 19:12:36 UTC (rev 65075) +++ trunk/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c 2011-11-11 19:43:04 UTC (rev 65076) @@ -131,7 +131,7 @@ return -1; } for (i = 0; i num_ret; i++) - val[i] = ((unsigned long *)prop_ret)[i]; + val[i] = ((unsigned int *)prop_ret)[i]; num = num_ret; *plst = val; } This fix is incorrect - man XGetWindowProperty. then val is wrong no it's not. leave it alone. leave it as it was. it was that way because longs tend to change between 32 and 64bits. ints tend to stay 32bits. yes we can have arguments over some architectures where int variest between 16 and 32bits, and some where long is always 32bits. reality is that on the architectures we work on/support (linux/the vast majority of unixes/mingw32 etc) int == 32bit, long == 32/64 bit. X11 protocol specifies that the 32bit cardinal IS 32bits. its not related to size of long. xlib used long because way back in those horrible 1980's sometimes ints were 16bit and thus you lost half your bits... -- - Codito, ergo sum - I code, therefore I am -- The Rasterman (Carsten Haitzler)ras...@rasterman.com -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On 21/07/11 16:03, Vincent Torri wrote: as you're adding functions to ecore_x : http://trac.enlightenment.org/e/ticket/73 Vincent Dh, Also, please add docs, or at least @since 1.1.0... -- Tom. -- 5 Ways to Improve Secure Unified Communications Unified Communications promises greater efficiencies for business. UC can improve internal communications as well as offer faster, more efficient ways to interact with customers and streamline customer service. Learn more! http://www.accelacomm.com/jaw/sfnl/114/51426253/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On 07/21/11 09:12, Tom Hacohen wrote: On 21/07/11 16:03, Vincent Torri wrote: as you're adding functions to ecore_x : http://trac.enlightenment.org/e/ticket/73 Vincent Dh, Also, please add docs, or at least @since 1.1.0... -- Tom. Tom, Will add some docs shortly dh -- 5 Ways to Improve Secure Unified Communications Unified Communications promises greater efficiencies for business. UC can improve internal communications as well as offer faster, more efficient ways to interact with customers and streamline customer service. Learn more! http://www.accelacomm.com/jaw/sfnl/114/51426253/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: devilhorns trunk/ecore/src/lib/ecore_x/xlib
On 21/07/11 16:47, Christopher Michael wrote: Will add some docs shortly Yay. :P -- 5 Ways to Improve Secure Unified Communications Unified Communications promises greater efficiencies for business. UC can improve internal communications as well as offer faster, more efficient ways to interact with customers and streamline customer service. Learn more! http://www.accelacomm.com/jaw/sfnl/114/51426253/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel