From: John L. <mov...@us...> - 2001-09-22 23:05:16
|
Update of /cvsroot/oprofile/oprofile/dae In directory usw-pr-cvs1:/tmp/cvs-serv9098/dae Modified Files: opd_util.c opd_util.h oprofiled.c Log Message: Small fixes + big GUI update. GUI is now almost done; Philippe please have a look when you get back. Index: opd_util.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/dae/opd_util.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- opd_util.c 2001/09/20 03:20:36 1.21 +++ opd_util.c 2001/09/22 23:05:11 1.22 @@ -790,3 +790,21 @@ } while (count < 0); return count; } + + +/** + * opd_poptGetContext - wrapper for popt + * + * Use this instead of poptGetContext to cope with + * different popt versions. + */ +poptContext opd_poptGetContext(const char * name, + int argc, const char ** argv, + const struct poptOption * options, int flags) +{ +#ifdef CONST_POPT + return poptGetContext(name, argc, argv, options, flags); +#else + return poptGetContext(name, argc, (char **)argv, options, flags); +#endif +} Index: opd_util.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/dae/opd_util.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- opd_util.h 2001/09/20 03:20:36 1.15 +++ opd_util.h 2001/09/22 23:05:11 1.16 @@ -26,6 +26,7 @@ #include <errno.h> #include <time.h> #include <fcntl.h> +#include <popt.h> #include "../op_user.h" @@ -64,6 +65,11 @@ #ifdef __cplusplus extern "C" { #endif + +/* ugh */ +poptContext opd_poptGetContext(const char * name, + int argc, const char ** argv, + const struct poptOption * options, int flags); /* utility functions */ #define opd_calloc(memb, size) opd_malloc(memb*size) Index: oprofiled.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/dae/oprofiled.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- oprofiled.c 2001/09/20 03:20:36 1.44 +++ oprofiled.c 2001/09/22 23:05:11 1.45 @@ -161,8 +161,7 @@ /* should be sufficient to hold /proc/sys/dev/oprofile/%d/yyyy */ char filename[PATH_MAX + 1]; - /* Some old version of popt need the cast to char ** */ - optcon = poptGetContext(NULL, argc, (char **)argv, options, 0); + optcon = opd_poptGetContext(NULL, argc, argv, options, 0); c=poptGetNextOpt(optcon); |