From: Peter Johnson Date: Sat, 11 Nov 2006 06:00:22 +0000 (-0000) Subject: Use is_exp2() in a couple more places. X-Git-Tag: v0.6.0~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67c788797c6a347aad50aac11d818ae054a009db;p=yasm Use is_exp2() in a couple more places. svn path=/trunk/yasm/; revision=1683 --- diff --git a/modules/parsers/gas/gas-bison.y b/modules/parsers/gas/gas-bison.y index 209b3712..5eb62bd2 100644 --- a/modules/parsers/gas/gas-bison.y +++ b/modules/parsers/gas/gas-bison.y @@ -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); } diff --git a/modules/parsers/nasm/nasm-bison.y b/modules/parsers/nasm/nasm-bison.y index 038df52d..9fc0dcdb 100644 --- a/modules/parsers/nasm/nasm-bison.y +++ b/modules/parsers/nasm/nasm-bison.y @@ -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);