~vcs-imports/nasm/main

« back to all changes in this revision

Viewing changes to disasm.c

  • Committer: hpa
  • Date: 2007-09-11 04:16:57 UTC
  • Revision ID: vcs-imports@canonical.com-20070911041657-iv9lzlrqhitc7spq
Make the big instruction arrays "const"

Make the big instruction arrays "const", so they end up in readonly
storage.  While we're at it, move their prototypes into insns.h.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "names.c"
21
21
 
22
 
extern struct itemplate **itable[];
23
 
 
24
22
/*
25
23
 * Flags that go into the `segment' field of `insn' structures
26
24
 * during disassembly.
313
311
 * Determine whether the instruction template in t corresponds to the data
314
312
 * stream in data. Return the number of bytes matched if so.
315
313
 */
316
 
static int matches(struct itemplate *t, uint8_t *data, int asize,
 
314
static int matches(const struct itemplate *t, uint8_t *data, int asize,
317
315
                   int osize, int segsize, int rep, insn * ins,
318
316
                   int rex, int *rexout, int lock)
319
317
{
582
580
int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize,
583
581
            int32_t offset, int autosync, uint32_t prefer)
584
582
{
585
 
    struct itemplate **p, **best_p;
 
583
    const struct itemplate * const *p, * const *best_p;
586
584
    int length, best_length = 0;
587
585
    char *segover;
588
586
    int rep, lock, asize, osize, i, slen, colon, rex, rexout, best_rex;