~mgiuca/dasm/makeinstall

« back to all changes in this revision

Viewing changes to src/exp.c

  • Committer: phf
  • Date: 2008-11-15 05:02:48 UTC
  • Revision ID: svn-v4:77a3a24b-2c49-0410-90f5-8a0d088e77bf:trunk:317
* introduced a variation of Martin Pool's UNUSED macro
* fixed a few int/size_t warnings
* v_err() now calls panic_fmt() as it should

Show diffs side-by-side

added added

removed removed

Lines of Context:
593
593
        */
594
594
        const unsigned char *ptr = (const unsigned char *)ptr1;
595
595
        char *new;
596
 
        int len;
597
 
        val = len = 0;
598
 
        while (*ptr && *ptr != '\"')
 
596
        size_t len = 0;
 
597
        val = 0;
 
598
        while (*ptr != '\0' && *ptr != '\"')
599
599
        {
600
600
            val = (val << 8) | *ptr;
601
601
            ++ptr;
603
603
        }
604
604
        new = checked_malloc(len + 1);
605
605
        memcpy(new, ptr1, len);
606
 
        new[len] = 0;
 
606
        new[len] = '\0';
607
607
        flags &= ~SYM_STRING;
608
608
        str = new;
609
609
    }
653
653
}
654
654
 
655
655
/* unary [phf] */
656
 
static void op_takelsb(long v1, long v2, dasm_flag_t f1, dasm_flag_t f2)
 
656
static void op_takelsb(long v1, long UNUSED(v2), dasm_flag_t f1, dasm_flag_t UNUSED(f2))
657
657
{
658
658
    stackarg(v1 & 0xFFL, f1, NULL);
659
659
}
660
660
 
661
 
static void op_takemsb(long v1, long v2, dasm_flag_t f1, dasm_flag_t f2)
 
661
static void op_takemsb(long v1, long UNUSED(v2), dasm_flag_t f1, dasm_flag_t UNUSED(f2))
662
662
{
663
663
    stackarg((v1 >> 8) & 0xFF, f1, NULL);
664
664
}
665
665
 
666
 
static void op_negate(long v1, long v2, dasm_flag_t f1, dasm_flag_t f2)
 
666
static void op_negate(long v1, long UNUSED(v2), dasm_flag_t f1, dasm_flag_t UNUSED(f2))
667
667
{
668
668
    stackarg(-v1, f1, NULL);
669
669
}
670
670
 
671
 
static void op_invert(long v1, long v2, dasm_flag_t f1, dasm_flag_t f2)
 
671
static void op_invert(long v1, long UNUSED(v2), dasm_flag_t f1, dasm_flag_t UNUSED(f2))
672
672
{
673
673
    stackarg(~v1, f1, NULL);
674
674
}
675
675
 
676
 
static void op_not(long v1, long v2, dasm_flag_t f1, dasm_flag_t f2)
 
676
static void op_not(long v1, long UNUSED(v2), dasm_flag_t f1, dasm_flag_t UNUSED(f2))
677
677
{
678
678
    stackarg(!v1, f1, NULL);
679
679
}