Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
as usual: @since (even typedef) ChangeLog NEWS Vincent On Thu, Feb 23, 2012 at 12:45 PM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: eina: introduce Eina_Stat to prevent issue when building with different config option. Author: cedric Date: 2012-02-23 03:45:25 -0800 (Thu, 23 Feb 2012) New Revision: 68315 Trac: http://trac.enlightenment.org/e/changeset/68315 Modified: trunk/eina/src/include/eina_file.h trunk/eina/src/lib/eina_file.c Modified: trunk/eina/src/include/eina_file.h === --- trunk/eina/src/include/eina_file.h 2012-02-23 11:27:45 UTC (rev 68314) +++ trunk/eina/src/include/eina_file.h 2012-02-23 11:45:25 UTC (rev 68315) @@ -92,6 +92,12 @@ typedef struct _Eina_File_Direct_Info Eina_File_Direct_Info; /** + * @typedef Eina_Stat + * A typedef to #_Eina_Stat. + */ +typedef struct _Eina_Stat Eina_Stat; + +/** * @typedef Eina_File_Dir_List_Cb * Type for a callback to be called when iterating over the files of a * directory. @@ -150,6 +156,30 @@ }; /** + * @struct _Eina_Stat + * A structure to store informations of a path. + */ +struct _Eina_Stat +{ + unsigned long int dev; + unsigned long int ino; + unsigned int mode; + unsigned int nlink; + unsigned int uid; + unsigned int gid; + unsigned long int rdev; + unsigned long int size; + unsigned long int blksize; + unsigned long int blocks; + unsigned long int atime; + unsigned long int atimensec; + unsigned long int mtime; + unsigned long int mtimensec; + unsigned long int ctime; + unsigned long int ctimensec; +}; + +/** * @def EINA_FILE_DIR_LIST_CB * @brief cast to an #Eina_File_Dir_List_Cb. * @@ -262,7 +292,7 @@ * @see eina_file_direct_ls() * @see eina_file_stat_ls() */ -EAPI int eina_file_stat(void *container, Eina_File_Direct_Info *info, struct stat *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2, 3); +EAPI int eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2, 3); /** * @brief Get an iterator to list the content of a directory, with direct Modified: trunk/eina/src/lib/eina_file.c === --- trunk/eina/src/lib/eina_file.c 2012-02-23 11:27:45 UTC (rev 68314) +++ trunk/eina/src/lib/eina_file.c 2012-02-23 11:45:25 UTC (rev 68315) @@ -362,14 +362,14 @@ static Eina_Bool _eina_file_stat_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data) { - struct stat st; + Eina_Stat st; if (!_eina_file_direct_ls_iterator_next(it, data)) return EINA_FALSE; if (it-info.type == EINA_FILE_UNKNOWN) { - if (eina_file_stat(it-dirp, it-info, st) != 0) + if (eina_file_statat(it-dirp, it-info, st) != 0) it-info.type = EINA_FILE_UNKNOWN; } @@ -1276,20 +1276,21 @@ } EAPI int -eina_file_stat(void *container, Eina_File_Direct_Info *info, struct stat *buf) +eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *st) { + struct stat buf; #ifdef HAVE_FSTATAT int fd; #endif EINA_SAFETY_ON_NULL_RETURN_VAL(info, -1); - EINA_SAFETY_ON_NULL_RETURN_VAL(buf, -1); + EINA_SAFETY_ON_NULL_RETURN_VAL(st, -1); #ifdef HAVE_FSTATAT fd = dirfd(container); - if (fstatat(fd, info-path + info-name_start, buf, 0)) + if (fstatat(fd, info-path + info-name_start, buf, 0)) #else - if (stat(info-path, buf)) + if (stat(info-path, buf)) #endif { if (info-type != EINA_FILE_LNK) @@ -1299,23 +1300,51 @@ if (info-type == EINA_FILE_UNKNOWN) { - if (S_ISREG(buf-st_mode)) + if (S_ISREG(buf.st_mode)) info-type = EINA_FILE_REG; - else if (S_ISDIR(buf-st_mode)) + else if (S_ISDIR(buf.st_mode)) info-type = EINA_FILE_DIR; - else if (S_ISCHR(buf-st_mode)) + else if (S_ISCHR(buf.st_mode)) info-type = EINA_FILE_CHR; - else if (S_ISBLK(buf-st_mode)) + else if (S_ISBLK(buf.st_mode)) info-type = EINA_FILE_BLK; - else if (S_ISFIFO(buf-st_mode)) + else if (S_ISFIFO(buf.st_mode)) info-type = EINA_FILE_FIFO; - else if (S_ISLNK(buf-st_mode)) + else if (S_ISLNK(buf.st_mode)) info-type = EINA_FILE_LNK; - else if (S_ISSOCK(buf-st_mode)) + else if (S_ISSOCK(buf.st_mode)) info-type = EINA_FILE_SOCK; else info-type = EINA_FILE_UNKNOWN; } + st-dev = buf.st_dev; + st-ino = buf.st_ino; + st-mode = buf.st_mode; + st-nlink = buf.st_nlink; + st-uid = buf.st_uid; + st-gid = buf.st_gid; + st-rdev = buf.st_rdev; + st-size = buf.st_size; + st-blksize = buf.st_blksize; + st-blocks = buf.st_blocks;
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
On Wed, Jan 11, 2012 at 11:37 AM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: eina: massiv fix for Eina_Value. Should be more portable and work with C++. NOTE: I still see an aliasing break in eina_value_pset, but wasn't able to figure how to solve it. Author: cedric Date: 2012-01-11 02:37:13 -0800 (Wed, 11 Jan 2012) New Revision: 67065 Trac: http://trac.enlightenment.org/e/changeset/67065 Modified: trunk/eina/src/include/eina_inline_value.x trunk/eina/src/include/eina_value.h trunk/eina/src/lib/eina_value.c Modified: trunk/eina/src/include/eina_inline_value.x === --- trunk/eina/src/include/eina_inline_value.x 2012-01-11 10:35:52 UTC (rev 67064) +++ trunk/eina/src/include/eina_inline_value.x 2012-01-11 10:37:13 UTC (rev 67065) @@ -20,6 +20,8 @@ #define EINA_INLINE_VALUE_X_ #include string.h +#include alloca.h aggg : not portable at all !!! Vincent + #include eina_stringshare.h /* NOTE: most of value is implemented here for performance reasons */ @@ -127,7 +129,7 @@ { if (type == EINA_VALUE_TYPE_STRINGSHARE) { - if (value-value.ptr) eina_stringshare_del(value-value.ptr); + if (value-value.ptr) eina_stringshare_del((const char*) value-value.ptr); } else if (type == EINA_VALUE_TYPE_STRING) { @@ -161,7 +163,7 @@ #ifndef EINA_VALUE_NO_OPTIMIZE if (type == EINA_VALUE_TYPE_UCHAR) { - unsigned char *ta = pa, *tb = pb; + unsigned char *ta = (unsigned char *) pa, *tb = (unsigned char *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -170,7 +172,7 @@ } else if (type == EINA_VALUE_TYPE_USHORT) { - unsigned short *ta = pa, *tb = pb; + unsigned short *ta = (unsigned short *) pa, *tb = (unsigned short *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -179,7 +181,7 @@ } else if (type == EINA_VALUE_TYPE_UINT) { - unsigned int *ta = pa, *tb = pb; + unsigned int *ta = (unsigned int *) pa, *tb = (unsigned int *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -188,7 +190,7 @@ } else if (type == EINA_VALUE_TYPE_ULONG) { - unsigned long *ta = pa, *tb = pb; + unsigned long *ta = (unsigned long *) pa, *tb = (unsigned long *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -197,7 +199,7 @@ } else if (type == EINA_VALUE_TYPE_UINT64) { - uint64_t *ta = pa, *tb = pb; + uint64_t *ta = (uint64_t *) pa, *tb = (uint64_t *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -206,7 +208,7 @@ } else if (type == EINA_VALUE_TYPE_CHAR) { - char *ta = pa, *tb = pb; + char *ta = (char *) pa, *tb = (char *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -215,7 +217,7 @@ } else if (type == EINA_VALUE_TYPE_SHORT) { - short *ta = pa, *tb = pb; + short *ta = (short *) pa, *tb = (short *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -224,7 +226,7 @@ } else if (type == EINA_VALUE_TYPE_INT) { - int *ta = pa, *tb = pb; + int *ta = (int *) pa, *tb = (int *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -233,7 +235,7 @@ } else if (type == EINA_VALUE_TYPE_LONG) { - long *ta = pa, *tb = pb; + long *ta = (long *) pa, *tb = (long *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -242,7 +244,7 @@ } else if (type == EINA_VALUE_TYPE_INT64) { - int64_t *ta = pa, *tb = pb; + int64_t *ta = (int64_t *) pa, *tb = (int64_t *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -251,7 +253,7 @@ } else if (type == EINA_VALUE_TYPE_FLOAT) { - float *ta = pa, *tb = pb; + float *ta = (float *) pa, *tb = (float *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -260,7 +262,7 @@ } else if (type == EINA_VALUE_TYPE_DOUBLE) { - double *ta = pa, *tb = pb; + double *ta = (double *) pa, *tb = (double *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -322,84 +324,84 @@ #ifndef EINA_VALUE_NO_OPTIMIZE if (type == EINA_VALUE_TYPE_UCHAR) { - unsigned char *tmem = mem; + unsigned char *tmem = (unsigned char *) mem; *tmem = va_arg(args, unsigned int); /* promoted by va_arg */ return EINA_TRUE; } else if (type == EINA_VALUE_TYPE_USHORT) { - unsigned short *tmem = mem; + unsigned short *tmem =
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
On Wed, Jan 11, 2012 at 11:41 AM, Vincent Torri vincent.to...@gmail.com wrote: On Wed, Jan 11, 2012 at 11:37 AM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: eina: massiv fix for Eina_Value. Should be more portable and work with C++. NOTE: I still see an aliasing break in eina_value_pset, but wasn't able to figure how to solve it. Author: cedric Date: 2012-01-11 02:37:13 -0800 (Wed, 11 Jan 2012) New Revision: 67065 Trac: http://trac.enlightenment.org/e/changeset/67065 Modified: trunk/eina/src/include/eina_inline_value.x trunk/eina/src/include/eina_value.h trunk/eina/src/lib/eina_value.c Modified: trunk/eina/src/include/eina_inline_value.x === --- trunk/eina/src/include/eina_inline_value.x 2012-01-11 10:35:52 UTC (rev 67064) +++ trunk/eina/src/include/eina_inline_value.x 2012-01-11 10:37:13 UTC (rev 67065) @@ -20,6 +20,8 @@ #define EINA_INLINE_VALUE_X_ #include string.h +#include alloca.h aggg : not portable at all !!! Damn forgot that one. It was just a missing header. Hum, we need to have an EINA_HAVE_ALLOCA or something like that now, I guess. + #include eina_stringshare.h /* NOTE: most of value is implemented here for performance reasons */ @@ -127,7 +129,7 @@ { if (type == EINA_VALUE_TYPE_STRINGSHARE) { - if (value-value.ptr) eina_stringshare_del(value-value.ptr); + if (value-value.ptr) eina_stringshare_del((const char*) value-value.ptr); } else if (type == EINA_VALUE_TYPE_STRING) { @@ -161,7 +163,7 @@ #ifndef EINA_VALUE_NO_OPTIMIZE if (type == EINA_VALUE_TYPE_UCHAR) { - unsigned char *ta = pa, *tb = pb; + unsigned char *ta = (unsigned char *) pa, *tb = (unsigned char *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -170,7 +172,7 @@ } else if (type == EINA_VALUE_TYPE_USHORT) { - unsigned short *ta = pa, *tb = pb; + unsigned short *ta = (unsigned short *) pa, *tb = (unsigned short *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -179,7 +181,7 @@ } else if (type == EINA_VALUE_TYPE_UINT) { - unsigned int *ta = pa, *tb = pb; + unsigned int *ta = (unsigned int *) pa, *tb = (unsigned int *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -188,7 +190,7 @@ } else if (type == EINA_VALUE_TYPE_ULONG) { - unsigned long *ta = pa, *tb = pb; + unsigned long *ta = (unsigned long *) pa, *tb = (unsigned long *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -197,7 +199,7 @@ } else if (type == EINA_VALUE_TYPE_UINT64) { - uint64_t *ta = pa, *tb = pb; + uint64_t *ta = (uint64_t *) pa, *tb = (uint64_t *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -206,7 +208,7 @@ } else if (type == EINA_VALUE_TYPE_CHAR) { - char *ta = pa, *tb = pb; + char *ta = (char *) pa, *tb = (char *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -215,7 +217,7 @@ } else if (type == EINA_VALUE_TYPE_SHORT) { - short *ta = pa, *tb = pb; + short *ta = (short *) pa, *tb = (short *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -224,7 +226,7 @@ } else if (type == EINA_VALUE_TYPE_INT) { - int *ta = pa, *tb = pb; + int *ta = (int *) pa, *tb = (int *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -233,7 +235,7 @@ } else if (type == EINA_VALUE_TYPE_LONG) { - long *ta = pa, *tb = pb; + long *ta = (long *) pa, *tb = (long *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -242,7 +244,7 @@ } else if (type == EINA_VALUE_TYPE_INT64) { - int64_t *ta = pa, *tb = pb; + int64_t *ta = (int64_t *) pa, *tb = (int64_t *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -251,7 +253,7 @@ } else if (type == EINA_VALUE_TYPE_FLOAT) { - float *ta = pa, *tb = pb; + float *ta = (float *) pa, *tb = (float *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -260,7 +262,7 @@ } else if (type == EINA_VALUE_TYPE_DOUBLE) { - double *ta = pa, *tb = pb; + double *ta = (double *) pa, *tb = (double *) pb; if (*ta *tb) return -1; else if (*ta *tb) @@ -322,84 +324,84 @@ #ifndef EINA_VALUE_NO_OPTIMIZE if (type == EINA_VALUE_TYPE_UCHAR) { - unsigned char *tmem = mem; + unsigned char *tmem = (unsigned char *) mem; *tmem =
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
On Wed, Jan 11, 2012 at 12:05 PM, Cedric BAIL cedric.b...@free.fr wrote: On Wed, Jan 11, 2012 at 11:41 AM, Vincent Torri vincent.to...@gmail.com wrote: On Wed, Jan 11, 2012 at 11:37 AM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: eina: massiv fix for Eina_Value. Should be more portable and work with C++. NOTE: I still see an aliasing break in eina_value_pset, but wasn't able to figure how to solve it. Author: cedric Date: 2012-01-11 02:37:13 -0800 (Wed, 11 Jan 2012) New Revision: 67065 Trac: http://trac.enlightenment.org/e/changeset/67065 Modified: trunk/eina/src/include/eina_inline_value.x trunk/eina/src/include/eina_value.h trunk/eina/src/lib/eina_value.c Modified: trunk/eina/src/include/eina_inline_value.x === --- trunk/eina/src/include/eina_inline_value.x 2012-01-11 10:35:52 UTC (rev 67064) +++ trunk/eina/src/include/eina_inline_value.x 2012-01-11 10:37:13 UTC (rev 67065) @@ -20,6 +20,8 @@ #define EINA_INLINE_VALUE_X_ #include string.h +#include alloca.h aggg : not portable at all !!! Damn forgot that one. It was just a missing header. Hum, we need to have an EINA_HAVE_ALLOCA or something like that now, I guess. see http://www.gnu.org/software/autoconf/manual/autoconf.html#Particular-Functions Vincent -- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
On Wed, Jan 11, 2012 at 8:37 AM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: eina: massiv fix for Eina_Value. Should be more portable and work with C++. NOTE: I still see an aliasing break in eina_value_pset, but wasn't able to figure how to solve it. Thanks! I couldn't test it with more than the tests I've wrote, then no C++ compiler used. How to trigger the aliasing break? compiler options? compile with g++? -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 -- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib tests
On Tue, Dec 6, 2011 at 5:57 PM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: eina: fix system header usage. Author: cedric Date: 2011-12-06 08:57:28 -0800 (Tue, 06 Dec 2011) New Revision: 65969 Trac: http://trac.enlightenment.org/e/changeset/65969 Modified: trunk/eina/src/include/eina_inline_array.x trunk/eina/src/include/eina_log.h trunk/eina/src/lib/eina_module.c trunk/eina/src/lib/eina_simple_xml_parser.c trunk/eina/src/tests/eina_bench_quad.c Modified: trunk/eina/src/include/eina_inline_array.x === --- trunk/eina/src/include/eina_inline_array.x 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/include/eina_inline_array.x 2011-12-06 16:57:28 UTC (rev 65969) @@ -19,6 +19,8 @@ #ifndef EINA_INLINE_ARRAY_X_ #define EINA_INLINE_ARRAY_X_ +#include stddef.h I hope that this header file exists on every platform we support. It seems to exist on Windows, but not sure on solaris Vincent + /** * @cond LOCAL */ Modified: trunk/eina/src/include/eina_log.h === --- trunk/eina/src/include/eina_log.h 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/include/eina_log.h 2011-12-06 16:57:28 UTC (rev 65969) @@ -20,6 +20,7 @@ #define EINA_LOG_H_ #include stdarg.h +#include sys/types.h #include eina_types.h Modified: trunk/eina/src/lib/eina_module.c === --- trunk/eina/src/lib/eina_module.c2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/lib/eina_module.c2011-12-06 16:57:28 UTC (rev 65969) @@ -37,6 +37,7 @@ void *alloca (size_t); #endif +#include stdlib.h #include stdio.h #include sys/types.h #include string.h Modified: trunk/eina/src/lib/eina_simple_xml_parser.c === --- trunk/eina/src/lib/eina_simple_xml_parser.c 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/lib/eina_simple_xml_parser.c 2011-12-06 16:57:28 UTC (rev 65969) @@ -41,6 +41,7 @@ #ifdef HAVE_STRINGS_H # include strings.h #endif +#include stdlib.h #include string.h #include ctype.h Modified: trunk/eina/src/tests/eina_bench_quad.c === --- trunk/eina/src/tests/eina_bench_quad.c 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/tests/eina_bench_quad.c 2011-12-06 16:57:28 UTC (rev 65969) @@ -19,6 +19,8 @@ #define WIDTH 720 #define HEIGHT 576 +#include stdlib.h + #include eina_main.h #include eina_mempool.h #include eina_rectangle.h -- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ ___ enlightenment-svn mailing list enlightenment-...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-svn -- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib tests
On Tue, Dec 6, 2011 at 6:19 PM, Vincent Torri vincent.to...@gmail.com wrote: On Tue, Dec 6, 2011 at 5:57 PM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: eina: fix system header usage. Author: cedric Date: 2011-12-06 08:57:28 -0800 (Tue, 06 Dec 2011) New Revision: 65969 Trac: http://trac.enlightenment.org/e/changeset/65969 Modified: trunk/eina/src/include/eina_inline_array.x trunk/eina/src/include/eina_log.h trunk/eina/src/lib/eina_module.c trunk/eina/src/lib/eina_simple_xml_parser.c trunk/eina/src/tests/eina_bench_quad.c Modified: trunk/eina/src/include/eina_inline_array.x === --- trunk/eina/src/include/eina_inline_array.x 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/include/eina_inline_array.x 2011-12-06 16:57:28 UTC (rev 65969) @@ -19,6 +19,8 @@ #ifndef EINA_INLINE_ARRAY_X_ #define EINA_INLINE_ARRAY_X_ +#include stddef.h I hope that this header file exists on every platform we support. It seems to exist on Windows, but not sure on solaris It was already present in some of our public header, so I assumed it was fine. + /** * @cond LOCAL */ Modified: trunk/eina/src/include/eina_log.h === --- trunk/eina/src/include/eina_log.h 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/include/eina_log.h 2011-12-06 16:57:28 UTC (rev 65969) @@ -20,6 +20,7 @@ #define EINA_LOG_H_ #include stdarg.h +#include sys/types.h #include eina_types.h Modified: trunk/eina/src/lib/eina_module.c === --- trunk/eina/src/lib/eina_module.c 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/lib/eina_module.c 2011-12-06 16:57:28 UTC (rev 65969) @@ -37,6 +37,7 @@ void *alloca (size_t); #endif +#include stdlib.h #include stdio.h #include sys/types.h #include string.h Modified: trunk/eina/src/lib/eina_simple_xml_parser.c === --- trunk/eina/src/lib/eina_simple_xml_parser.c 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/lib/eina_simple_xml_parser.c 2011-12-06 16:57:28 UTC (rev 65969) @@ -41,6 +41,7 @@ #ifdef HAVE_STRINGS_H # include strings.h #endif +#include stdlib.h #include string.h #include ctype.h Modified: trunk/eina/src/tests/eina_bench_quad.c === --- trunk/eina/src/tests/eina_bench_quad.c 2011-12-06 16:55:50 UTC (rev 65968) +++ trunk/eina/src/tests/eina_bench_quad.c 2011-12-06 16:57:28 UTC (rev 65969) @@ -19,6 +19,8 @@ #define WIDTH 720 #define HEIGHT 576 +#include stdlib.h + #include eina_main.h #include eina_mempool.h #include eina_rectangle.h -- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ ___ enlightenment-svn mailing list enlightenment-...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-svn -- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- Cedric BAIL -- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
On Sun, Apr 24, 2011 at 10:32 PM, Vincent Torri vto...@univ-evry.fr wrote: On Sun, 24 Apr 2011, Enlightenment SVN wrote: Log: eina: put global into namespace and add lock abort Author: cedric Date: 2011-04-24 13:22:17 -0700 (Sun, 24 Apr 2011) New Revision: 58875 Trac: http://trac.enlightenment.org/e/changeset/58875 Modified: trunk/eina/src/include/eina_inline_lock_posix.x trunk/eina/src/lib/eina_main.c Modified: trunk/eina/src/include/eina_inline_lock_posix.x === --- trunk/eina/src/include/eina_inline_lock_posix.x 2011-04-24 20:21:07 UTC (rev 58874) +++ trunk/eina/src/include/eina_inline_lock_posix.x 2011-04-24 20:22:17 UTC (rev 58875) @@ -23,12 +23,29 @@ typedef pthread_mutex_t Eina_Lock; -EAPI extern Eina_Bool _threads_activated; +EAPI extern Eina_Bool _eina_threads_activated; you forgot to update other lock files (win32 and wince) Oops, forgot. Will fix asap. -- Cedric BAIL -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
On Sun, 24 Apr 2011, Enlightenment SVN wrote: Log: eina: put global into namespace and add lock abort Author: cedric Date: 2011-04-24 13:22:17 -0700 (Sun, 24 Apr 2011) New Revision: 58875 Trac: http://trac.enlightenment.org/e/changeset/58875 Modified: trunk/eina/src/include/eina_inline_lock_posix.x trunk/eina/src/lib/eina_main.c Modified: trunk/eina/src/include/eina_inline_lock_posix.x === --- trunk/eina/src/include/eina_inline_lock_posix.x 2011-04-24 20:21:07 UTC (rev 58874) +++ trunk/eina/src/include/eina_inline_lock_posix.x 2011-04-24 20:22:17 UTC (rev 58875) @@ -23,12 +23,29 @@ typedef pthread_mutex_t Eina_Lock; -EAPI extern Eina_Bool _threads_activated; +EAPI extern Eina_Bool _eina_threads_activated; you forgot to update other lock files (win32 and wince) Vincent +#ifdef EINA_HAVE_DEBUG_THREADS +# include sys/time.h + +EAPI extern int _eina_threads_debug; +#endif + static inline Eina_Bool eina_lock_new(Eina_Lock *mutex) { - return (pthread_mutex_init(mutex, NULL) == 0) ? EINA_TRUE : EINA_FALSE; + pthread_mutexattr_t attr; + + if (pthread_mutexattr_init(attr) != 0) + return EINA_FALSE; + if (pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE) != 0) + return EINA_FALSE; + if (pthread_mutex_init(mutex, attr) != 0) + return EINA_FALSE; + + pthread_mutexattr_destroy(attr); + + return EINA_TRUE; } static inline void @@ -40,15 +57,37 @@ static inline Eina_Bool eina_lock_take(Eina_Lock *mutex) { - if (_threads_activated) - return (pthread_mutex_lock(mutex) == 0) ? EINA_TRUE : EINA_FALSE; + if (_eina_threads_activated) + { +#ifdef EINA_HAVE_DEBUG_THREADS + if (_eina_threads_debug) + { + struct timeval t0, t1; + int dt; + + gettimeofday(t0, NULL); + pthread_mutex_lock((x)); + gettimeofday(t1, NULL); + + dt = (t1.tv_sec - t0.tv_sec) * 100; + if (t1.tv_usec t0.tv_usec) +dt += (t1.tv_usec - t0.tv_usec); + else +dt -= t0.tv_usec - t1.tv_usec; + dt /= 1000; + + if (dt _eina_threads_debug) abort(); + } +#endif + return (pthread_mutex_lock(mutex) == 0) ? EINA_TRUE : EINA_FALSE; + } return EINA_FALSE; } static inline Eina_Bool eina_lock_take_try(Eina_Lock *mutex) { - if (_threads_activated) + if (_eina_threads_activated) return (pthread_mutex_trylock(mutex) == 0) ? EINA_TRUE : EINA_FALSE; return EINA_FALSE; } @@ -56,7 +95,7 @@ static inline Eina_Bool eina_lock_release(Eina_Lock *mutex) { - if (_threads_activated) + if (_eina_threads_activated) return (pthread_mutex_unlock(mutex) == 0) ? EINA_TRUE : EINA_FALSE; return EINA_FALSE; } Modified: trunk/eina/src/lib/eina_main.c === --- trunk/eina/src/lib/eina_main.c2011-04-24 20:21:07 UTC (rev 58874) +++ trunk/eina/src/lib/eina_main.c2011-04-24 20:22:17 UTC (rev 58875) @@ -74,8 +74,12 @@ #endif #define DBG(...) EINA_LOG_DOM_DBG(_eina_log_dom, __VA_ARGS__) -EAPI Eina_Bool _threads_activated = EINA_FALSE; +EAPI Eina_Bool _eina_threads_activated = EINA_FALSE; +#ifdef EINA_HAVE_DEBUG_THREADS +EAPI int _eina_threads_debug = 0; +#endif + static Eina_Lock _mutex; /* place module init/shutdown functions here to avoid other modules @@ -213,6 +217,10 @@ } eina_lock_new(_mutex); +#ifdef EINA_HAVE_DEBUG_THREADS + if (getenv(EINA_DEBUG_THREADS)) + _eina_threads_debug = atoi(getenv(EINA_DEBUG_THREADS); +#endif _eina_main_count = 1; return 1; @@ -252,7 +260,7 @@ eina_share_common_threads_init(); eina_log_threads_init(); - _threads_activated = EINA_TRUE; + _eina_threads_activated = EINA_TRUE; eina_lock_release(_mutex); @@ -281,7 +289,7 @@ eina_lock_release(_mutex); - _threads_activated = EINA_FALSE; + _eina_threads_activated = EINA_FALSE; return ret; #else -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails ___ enlightenment-svn mailing list enlightenment-...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-svn -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your
Re: [E-devel] E SVN: cedric IN trunk/eina/src: include lib
On Tue, Jan 20, 2009 at 1:44 PM, Enlightenment SVN no-re...@enlightenment.org wrote: Log: * eina/src/include/eina_private.h, * eina/src/lib/eina_array.c: Remove potential error detected by llvm in eina_array. #define MAGIC_FREE(ptr)\ - do { \ + if (ptr) { \ EINA_MAGIC_SET(ptr, EINA_MAGIC_NONE); \ FREE(ptr);\ - } while(0); + } you need do {} while(0) so you don't mess with outer ifs, see http://kernelnewbies.org/FAQ/DoWhile0 - #endif /* EINA_PRIVATE_H_ */ Modified: trunk/eina/src/lib/eina_array.c === --- trunk/eina/src/lib/eina_array.c 2009-01-20 15:42:34 UTC (rev 38661) +++ trunk/eina/src/lib/eina_array.c 2009-01-20 15:44:52 UTC (rev 38662) @@ -94,6 +94,7 @@ { EINA_MAGIC_CHECK_ARRAY_ITERATOR(it); + if (!it) return EINA_FALSE; if (!(it-index eina_array_count_get(it-array))) return EINA_FALSE; if (data) @@ -106,7 +107,7 @@ eina_array_iterator_get_container(Eina_Iterator_Array *it) { EINA_MAGIC_CHECK_ARRAY_ITERATOR(it); - return (Eina_Array *) it-array; + return it ? (Eina_Array *) it-array : NULL; } these internal cases that are already guarded elsewhere should be marked with EINA_ARGS_NONULL(). It is impossible to get a NULL iterator there, since one uses the iterator to figure out the callback. So please create a prototypes and mark them appropriately. -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel