From: Richard Kettlewell Date: Sat, 24 May 2014 14:00:30 +0000 (+0100) Subject: Use shifts rather than multiplies to scale up size requests. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=vbig.git;a=commitdiff_plain;h=f9b330f2c52875867de36cc1af1429ae37dfa2eb Use shifts rather than multiplies to scale up size requests. --- diff --git a/vbig.cc b/vbig.cc index 338052e..86e24bf 100644 --- a/vbig.cc +++ b/vbig.cc @@ -215,11 +215,11 @@ int main(int argc, char **argv) { if(end == argv[1]) fatal(0, "invalid size"); if(!strcmp(end, "K")) - size *= 1024; + size <<= 10; else if(!strcmp(end, "M")) - size *= 1024 * 1024; + size <<= 20; else if(!strcmp(end, "G")) - size *= 1024 * 1024 * 1024; + size <<= 30; else if(*end) fatal(0, "invalid size"); } else if(entireopt) {