Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
df45a347
Commit
df45a347
authored
Dec 30, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Store location information in strings.
parent
d0a6c806
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
0 deletions
+29
-0
genres.c
tools/wrc/genres.c
+6
-0
newstruc.c
tools/wrc/newstruc.c
+1
-0
utils.c
tools/wrc/utils.c
+2
-0
wrc.h
tools/wrc/wrc.h
+12
-0
wrctypes.h
tools/wrc/wrctypes.h
+8
-0
No files found.
tools/wrc/genres.c
View file @
df45a347
...
...
@@ -312,11 +312,17 @@ static void put_string(res_t *res, const string_t *str, enum str_e type, int ist
if
(
str
->
type
==
str_char
)
{
if
(
!
check_unicode_conversion
(
str
,
newstr
,
codepage
))
{
print_location
(
&
str
->
loc
);
error
(
"String %s does not convert identically to Unicode and back in codepage %d. "
"Try using a Unicode string instead
\n
"
,
str
->
str
.
cstr
,
codepage
);
}
if
(
check_valid_utf8
(
str
,
codepage
))
{
print_location
(
&
str
->
loc
);
warning
(
"string
\"
%s
\"
seems to be UTF-8 but codepage %u is in use.
\n
"
,
str
->
str
.
cstr
,
codepage
);
}
}
if
(
!
isterm
)
put_word
(
res
,
newstr
->
size
);
for
(
cnt
=
0
;
cnt
<
newstr
->
size
;
cnt
++
)
...
...
tools/wrc/newstruc.c
View file @
df45a347
...
...
@@ -166,6 +166,7 @@ string_t *new_string(void)
{
string_t
*
ret
=
xmalloc
(
sizeof
(
*
ret
)
);
memset
(
ret
,
0
,
sizeof
(
*
ret
)
);
set_location
(
&
ret
->
loc
);
return
ret
;
}
...
...
tools/wrc/utils.c
View file @
df45a347
...
...
@@ -271,6 +271,8 @@ string_t *convert_string(const string_t *str, enum str_e type, int codepage)
string_t
*
ret
=
xmalloc
(
sizeof
(
*
ret
));
int
res
;
ret
->
loc
=
str
->
loc
;
if
(
!
codepage
&&
str
->
type
!=
type
)
parser_error
(
"Current language is Unicode only, cannot convert string"
);
...
...
tools/wrc/wrc.h
View file @
df45a347
...
...
@@ -59,4 +59,16 @@ extern language_t *currentlanguage;
void
verify_translations
(
resource_t
*
top
);
void
write_resfile
(
char
*
outname
,
resource_t
*
top
);
static
inline
void
set_location
(
location_t
*
loc
)
{
loc
->
file
=
input_name
;
loc
->
line
=
line_number
;
loc
->
col
=
char_number
;
}
static
inline
void
print_location
(
const
location_t
*
loc
)
{
if
(
loc
->
file
)
fprintf
(
stderr
,
"%s:%d:%d: "
,
loc
->
file
,
loc
->
line
,
loc
->
col
);
}
#endif
tools/wrc/wrctypes.h
View file @
df45a347
...
...
@@ -83,6 +83,13 @@
#define BYTESWAP_WORD(w) ((WORD)(((WORD)WRC_LOBYTE(w) << 8) + (WORD)WRC_HIBYTE(w)))
#define BYTESWAP_DWORD(d) ((DWORD)(((DWORD)BYTESWAP_WORD(WRC_LOWORD(d)) << 16) + ((DWORD)BYTESWAP_WORD(WRC_HIWORD(d)))))
typedef
struct
{
const
char
*
file
;
int
line
;
int
col
;
}
location_t
;
/* Binary resource structure */
#define RES_BLOCKSIZE 512
...
...
@@ -103,6 +110,7 @@ typedef struct string {
char
*
cstr
;
WCHAR
*
wstr
;
}
str
;
location_t
loc
;
}
string_t
;
/* Resources are identified either by name or by number */
...
...
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