summaryrefslogtreecommitdiff
path: root/test1.c
diff options
context:
space:
mode:
authorjbj <jbj>2008-02-12 23:53:18 +0000
committerjbj <jbj>2008-02-12 23:53:18 +0000
commit2e0e4b219baf0e3901432fd7241d1537735840bc (patch)
tree921712411a42ffc42f7575ba7e0a820074bee1c0 /test1.c
parentb85d91fda8a38a797d0ecb5e761e0f14930c4974 (diff)
downloadlibpopt-2e0e4b219baf0e3901432fd7241d1537735840bc.tar.gz
- jbj: hmmm, POSIXly correct --echo-args needs fixing, disable for now.
- jbj: poptint.h: typedef's for string and string arrays. - jbj: add POPT_ARG_LONGLONG, and poptSaveLongLong().
Diffstat (limited to 'test1.c')
-rw-r--r--test1.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/test1.c b/test1.c
index deddc92..646d89d 100644
--- a/test1.c
+++ b/test1.c
@@ -42,9 +42,13 @@ static int aInt = 271828;
/*@unchecked@*/
static int bInt = 271828;
/*@unchecked@*/
-static long aLong = 738905609L;
+static long aLong = 738905609LL;
/*@unchecked@*/
-static long bLong = 738905609L;
+static long bLong = 738905609LL;
+/*@unchecked@*/
+static long long aLongLong = 738905609L;
+/*@unchecked@*/
+static long long bLongLong = 738905609L;
/*@unchecked@*/
static float aFloat = 3.1415926535;
/*@unchecked@*/
@@ -121,6 +125,8 @@ static struct poptOption options[] = {
"POPT_ARG_INT: 271828", NULL },
{ "long", 'l', POPT_ARG_LONG | POPT_ARGFLAG_SHOW_DEFAULT, &aLong, 0,
"POPT_ARG_LONG: 738905609", NULL },
+ { "longlong", 'L', POPT_ARG_LONGLONG | POPT_ARGFLAG_SHOW_DEFAULT, &aLongLong, 0,
+ "POPT_ARG_LONGLONG: 738905609", NULL },
{ "float", 'f', POPT_ARG_FLOAT | POPT_ARGFLAG_SHOW_DEFAULT, &aFloat, 0,
"POPT_ARG_FLOAT: 3.14159", NULL },
{ "double", 'd', POPT_ARG_DOUBLE | POPT_ARGFLAG_SHOW_DEFAULT, &aDouble, 0,
@@ -148,10 +154,10 @@ static struct poptOption options[] = {
static void resetVars(void)
/*@globals arg1, arg2, arg3, inc, shortopt,
- aVal, aFlag, aInt, aLong, aFloat, aDouble,
+ aVal, aFlag, aInt, aLong, aLongLong, aFloat, aDouble,
oStr, singleDash, pass2 @*/
/*@modifies arg1, arg2, arg3, inc, shortopt,
- aVal, aFlag, aInt, aLong, aFloat, aDouble,
+ aVal, aFlag, aInt, aLong, aLongLong, aFloat, aDouble,
oStr, singleDash, pass2 @*/
{
arg1 = 0;
@@ -165,6 +171,7 @@ static void resetVars(void)
aInt = bInt;
aLong = bLong;
+ aLongLong = bLongLong;
aFloat = bFloat;
aDouble = bDouble;
@@ -243,6 +250,8 @@ int main(int argc, const char ** argv)
fprintf(stdout, " aInt: %d", aInt);
if (aLong != bLong)
fprintf(stdout, " aLong: %ld", aLong);
+ if (aLongLong != bLongLong)
+ fprintf(stdout, " aLongLong: %lld", aLongLong);
/*@-realcompare@*/
if (aFloat != bFloat)
fprintf(stdout, " aFloat: %g", (double)aFloat);