mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-26 19:47:17 +00:00
usleep: fix compile errors
Update usleep.c to fix following compile error:
| usleep.c: In function 'main':
| usleep.c:47:43: error: passing argument 3 of 'poptGetContext' from incompatible pointer type [-Wincompatible-pointer-types]
| 47 | optCon = poptGetContext("usleep", argc, argv, options,0);
| | ^~~~
| | |
| | char **
| In file included from usleep.c:29:
| /path_to/tmp-glibc/work/core2-64-wrs-linux/usleep/1.2/recipe-sysroot/usr/include/popt.h:217:41: note: expected 'const char **' but argument is of type 'char **'
| 217 | int argc, const char ** argv,
| | ~~~~~~~~~~~~~~^~~~
| usleep.c:68:12: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
| 68 | countStr = poptGetArg(optCon);
| | ^
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -34,7 +34,7 @@ int main(int argc, char **argv) {
|
|||||||
int showVersion = 0;
|
int showVersion = 0;
|
||||||
int showOot = 0;
|
int showOot = 0;
|
||||||
int rc;
|
int rc;
|
||||||
char * countStr = NULL;
|
const char * countStr = NULL;
|
||||||
struct poptOption options[] = {
|
struct poptOption options[] = {
|
||||||
{ "version", 'v', POPT_ARG_NONE, &showVersion, 0,
|
{ "version", 'v', POPT_ARG_NONE, &showVersion, 0,
|
||||||
"Display the version of this program, and exit" },
|
"Display the version of this program, and exit" },
|
||||||
@@ -44,7 +44,7 @@ int main(int argc, char **argv) {
|
|||||||
{ 0, 0, 0, 0, 0 }
|
{ 0, 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
optCon = poptGetContext("usleep", argc, argv, options,0);
|
optCon = poptGetContext("usleep", argc, (const char **)argv, options,0);
|
||||||
/*poptReadDefaultConfig(optCon, 1);*/
|
/*poptReadDefaultConfig(optCon, 1);*/
|
||||||
poptSetOtherOptionHelp(optCon, "[microseconds]");
|
poptSetOtherOptionHelp(optCon, "[microseconds]");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user