]> granicus.if.org Git - yasm/commitdiff
Use is_exp2() in a couple more places.
authorPeter Johnson <peter@tortall.net>
Sat, 11 Nov 2006 06:00:22 +0000 (06:00 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 11 Nov 2006 06:00:22 +0000 (06:00 -0000)
svn path=/trunk/yasm/; revision=1683

modules/parsers/gas/gas-bison.y
modules/parsers/nasm/nasm-bison.y

index 209b371271193323d5d63a58065a40a45fad9be6..5eb62bd22c31841a52bec31454f5594a5638b9d8 100644 (file)
@@ -937,7 +937,7 @@ gas_parser_align(yasm_parser_gas *parser_gas, yasm_section *sect,
        unsigned long boundint = yasm_intnum_get_uint(boundintn);
 
        /* Alignments must be a power of two. */
-       if ((boundint & (boundint - 1)) == 0) {
+       if (is_exp2(boundint)) {
            if (boundint > yasm_section_get_align(sect))
                yasm_section_set_align(sect, boundint, cur_line);
        }
index 038df52dfbd0b93602f5be58de43bb7006faeb75..9fc0dcdb18084601691ddc3b3ea9ee5ed2438fcb 100644 (file)
@@ -640,7 +640,7 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name,
            unsigned long boundint = yasm_intnum_get_uint(boundintn);
 
            /* Alignments must be a power of two. */
-           if ((boundint & (boundint - 1)) == 0) {
+           if (is_exp2(boundint)) {
                if (boundint > yasm_section_get_align(parser_nasm->cur_section))
                    yasm_section_set_align(parser_nasm->cur_section, boundint,
                                           cur_line);