Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
59538625
Commit
59538625
authored
Mar 13, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwpp: Use __int64 instead of long long.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9068ad0f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
59 deletions
+28
-59
ppl.l
libs/wpp/ppl.l
+16
-24
ppy.y
libs/wpp/ppy.y
+10
-10
wpp_private.h
libs/wpp/wpp_private.h
+2
-25
No files found.
libs/wpp/ppl.l
View file @
59538625
...
...
@@ -171,11 +171,11 @@ ul [uUlL]|[uUlL][lL]|[lL][uU]|[lL][lL][uU]|[uU][lL][lL]|[lL][uU][lL]
#include <limits.h>
#ifndef LLONG_MAX
# define LLONG_MAX ((
long long
)0x7fffffff << 32 | 0xffffffff)
# define LLONG_MAX ((
__int64
)0x7fffffff << 32 | 0xffffffff)
# define LLONG_MIN (-LLONG_MAX - 1)
#endif
#ifndef ULLONG_MAX
# define ULLONG_MAX ((
long long
)0xffffffff << 32 | 0xffffffff)
# define ULLONG_MAX ((
__int64
)0xffffffff << 32 | 0xffffffff)
#endif
#ifndef HAVE_UNISTD_H
...
...
@@ -899,29 +899,21 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len)
is_u++;
}
if(is_ll)
if(is_
u && is_
ll)
{
/* Assume as in the declaration of wrc_ull_t and wrc_sll_t */
#ifdef HAVE_LONG_LONG
if (is_u)
{
errno = 0;
val->ull = strtoull(str, NULL, radix);
if (val->ull == ULLONG_MAX && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tULONGLONG;
}
else
{
errno = 0;
val->sll = strtoll(str, NULL, radix);
if ((val->sll == LLONG_MIN || val->sll == LLONG_MAX) && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tSLONGLONG;
}
#else
pp_internal_error(__FILE__, __LINE__, "long long constants not supported on this platform");
#endif
errno = 0;
val->ull = strtoull(str, NULL, radix);
if (val->ull == ULLONG_MAX && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tULONGLONG;
}
else if(!is_u && is_ll)
{
errno = 0;
val->sll = strtoll(str, NULL, radix);
if ((val->sll == LLONG_MIN || val->sll == LLONG_MAX) && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tSLONGLONG;
}
else if(is_u && is_l)
{
...
...
libs/wpp/ppy.y
View file @
59538625
...
...
@@ -81,9 +81,9 @@
if(cv_signed(v1) && cv_signed(v2)) \
r.val.sll = v1.val.sll OP v2.val.sll; \
else if(cv_signed(v1) && !cv_signed(v2)) \
r.val.sll = v1.val.sll OP (
wrc_sll_t
) v2.val.ull; \
r.val.sll = v1.val.sll OP (
__int64
) v2.val.ull; \
else if(!cv_signed(v1) && cv_signed(v2)) \
r.val.sll = (
wrc_sll_t
) v1.val.ull OP v2.val.sll; \
r.val.sll = (
__int64
) v1.val.ull OP v2.val.sll; \
else \
r.val.ull = v1.val.ull OP v2.val.ull;
...
...
@@ -128,8 +128,8 @@ static int nmacro_args;
unsigned int uint;
long slong;
unsigned long ulong;
wrc_sll_t
sll;
wrc_ull_t
ull;
__int64
sll;
unsigned __int64
ull;
int *iptr;
char *cptr;
cval_t cval;
...
...
@@ -539,12 +539,12 @@ static int boolean(cval_t *v)
{
switch(v->type)
{
case cv_sint: return v->val.si !=
(int)
0;
case cv_uint: return v->val.ui !=
(unsigned int)
0;
case cv_slong: return v->val.sl !=
(long)
0;
case cv_ulong: return v->val.ul !=
(unsigned long)
0;
case cv_sll: return v->val.sll !=
(wrc_sll_t)
0;
case cv_ull: return v->val.ull !=
(wrc_ull_t)
0;
case cv_sint: return v->val.si != 0;
case cv_uint: return v->val.ui != 0;
case cv_slong: return v->val.sl != 0;
case cv_ulong: return v->val.ul != 0;
case cv_sll: return v->val.sll != 0;
case cv_ull: return v->val.ull != 0;
}
return 0;
}
...
...
libs/wpp/wpp_private.h
View file @
59538625
...
...
@@ -20,10 +20,6 @@
#ifndef __WINE_WPP_PRIVATE_H
#define __WINE_WPP_PRIVATE_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#include <stdio.h>
#include <string.h>
...
...
@@ -136,25 +132,6 @@ typedef struct
int
seen_junk
;
/* Set when junk is seen */
}
include_state_t
;
/*
* If the configure says we have long long then we can use it. Presumably
* if we have long long then we have strtoull and strtoll too. If that is
* not the case we will need to add to the configure tests.
* If we do not have long long , then we revert to a simple 'long' for now.
* This should prevent most unexpected things with other compilers than
* gcc and egcs for now.
* In the future it should be possible to use another way, like a
* structure, so that we can emulate the MS compiler.
*/
#ifdef HAVE_LONG_LONG
typedef
long
long
wrc_sll_t
;
typedef
unsigned
long
long
wrc_ull_t
;
#else
typedef
long
wrc_sll_t
;
typedef
unsigned
long
wrc_ull_t
;
#endif
#define SIZE_CHAR 1
#define SIZE_SHORT 2
#define SIZE_INT 3
...
...
@@ -191,8 +168,8 @@ typedef struct cval {
unsigned
int
ui
;
long
sl
;
unsigned
long
ul
;
wrc_sll_t
sll
;
wrc_ull_t
ull
;
__int64
sll
;
unsigned
__int64
ull
;
}
val
;
}
cval_t
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment