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
33052098
Commit
33052098
authored
Sep 13, 2010
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler_43: Move asmparser_message() and asmshader_error() up to avoid forward declarations.
parent
ab6ad772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
47 deletions
+47
-47
asmshader.y
dlls/d3dcompiler_43/asmshader.y
+47
-47
No files found.
dlls/d3dcompiler_43/asmshader.y
View file @
33052098
...
...
@@ -32,9 +32,49 @@ WINE_DEFAULT_DEBUG_CHANNEL(asmshader);
struct asm_parser asm_ctx;
/* Needed lexer functions declarations */
void asmshader_error(const char *s);
int asmshader_lex(void);
/* Error reporting function */
void asmparser_message(struct asm_parser *ctx, const char *fmt, ...) {
va_list args;
char* newbuffer;
int rc, newsize;
if(ctx->messagecapacity == 0) {
ctx->messages = asm_alloc(MESSAGEBUFFER_INITIAL_SIZE);
if(ctx->messages == NULL) {
ERR("Error allocating memory for parser messages\n");
return;
}
ctx->messagecapacity = MESSAGEBUFFER_INITIAL_SIZE;
}
while(1) {
va_start(args, fmt);
rc = vsnprintf(ctx->messages + ctx->messagesize,
ctx->messagecapacity - ctx->messagesize, fmt, args);
va_end(args);
if (rc < 0 || /* C89 */
rc >= ctx->messagecapacity - ctx->messagesize) { /* C99 */
/* Resize the buffer */
newsize = ctx->messagecapacity * 2;
newbuffer = asm_realloc(ctx->messages, newsize);
if(newbuffer == NULL){
ERR("Error reallocating memory for parser messages\n");
return;
}
ctx->messages = newbuffer;
ctx->messagecapacity = newsize;
} else {
ctx->messagesize += rc;
return;
}
}
}
void asmshader_error(char const *s) {
asmparser_message(&asm_ctx, "Line %u: Error \"%s\" from bison\n", asm_ctx.line_no, s);
set_parse_status(&asm_ctx, PARSE_ERR);
}
void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
/* We can have an additional offset without true relative addressing
...
...
@@ -53,6 +93,10 @@ void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
}
}
/* Needed lexer functions declarations */
int asmshader_lex(void);
%}
%union {
...
...
@@ -1660,50 +1704,6 @@ predicate: '(' REG_PREDICATE swizzle ')'
%%
void asmshader_error (char const *s) {
asmparser_message(&asm_ctx, "Line %u: Error \"%s\" from bison\n", asm_ctx.line_no, s);
set_parse_status(&asm_ctx, PARSE_ERR);
}
/* Error reporting function */
void asmparser_message(struct asm_parser *ctx, const char *fmt, ...) {
va_list args;
char* newbuffer;
int rc, newsize;
if(ctx->messagecapacity == 0) {
ctx->messages = asm_alloc(MESSAGEBUFFER_INITIAL_SIZE);
if(ctx->messages == NULL) {
ERR("Error allocating memory for parser messages\n");
return;
}
ctx->messagecapacity = MESSAGEBUFFER_INITIAL_SIZE;
}
while(1) {
va_start(args, fmt);
rc = vsnprintf(ctx->messages + ctx->messagesize,
ctx->messagecapacity - ctx->messagesize, fmt, args);
va_end(args);
if (rc < 0 || /* C89 */
rc >= ctx->messagecapacity - ctx->messagesize) { /* C99 */
/* Resize the buffer */
newsize = ctx->messagecapacity * 2;
newbuffer = asm_realloc(ctx->messages, newsize);
if(newbuffer == NULL){
ERR("Error reallocating memory for parser messages\n");
return;
}
ctx->messages = newbuffer;
ctx->messagecapacity = newsize;
} else {
ctx->messagesize += rc;
return;
}
}
}
/* New status is the worst between current status and parameter value */
void set_parse_status(struct asm_parser *ctx, enum parse_status status) {
if(status == PARSE_ERR) ctx->status = PARSE_ERR;
...
...
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