d3dx9_36: Make asmshader_error() static.
Francois Gouget
fgouget at free.fr
Thu Jun 24 03:10:11 CDT 2010
---
dlls/d3dx9_36/asmshader.y | 92 ++++++++++++++++++++++----------------------
1 files changed, 46 insertions(+), 46 deletions(-)
Also moved it up to avoid a forward declaration.
diff --git a/dlls/d3dx9_36/asmshader.y b/dlls/d3dx9_36/asmshader.y
index 689a8fd..e210489 100644
--- a/dlls/d3dx9_36/asmshader.y
+++ b/dlls/d3dx9_36/asmshader.y
@@ -32,11 +32,55 @@ WINE_DEFAULT_DEBUG_CHANNEL(asmshader);
struct asm_parser asm_ctx;
+/* 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;
+ }
+ }
+}
+
+static 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);
+}
+
+
/* Needed lexer functions declarations */
-void asmshader_error(const char *s);
int asmshader_lex(void);
-void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
+static void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
/* We can have an additional offset without true relative addressing
* ex. c2[ 4 ] */
reg->regnum += rel->additional_offset;
@@ -1403,50 +1447,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;
--
1.7.1
More information about the wine-patches
mailing list