chiark / gitweb /
fix byte shift error
[ypp-sc-tools.main.git] / pctb / pages.c
index 361ea0ea9926b4cf576d1cdaedfafa5e00370477..de967310454085a02ce4ce467b1fa144cf7c2ba4 100644 (file)
@@ -229,7 +229,8 @@ static CanonImage *convert_page(Snapshot *sn) {
     long xrgb= XGetPixel(sn, x, y);
     int i;
     rgb= 0;
-    for (i=0; i<3; i++, rgb <<= 8) {
+    for (i=0; i<3; i++) {
+      rgb <<= 8;
       unsigned long sample=
        ((xrgb << shiftmasks[i].lshift)
              >> shiftmasks[i].rshift) & SAMPLEMASK;
@@ -249,7 +250,7 @@ void take_screenshots(void) {
 
   /* find the window and check it's on the right kind of screen */
   raise_and_get_details();
-  snapshot(&current);
+  wait_for_stability(&current,0,0);
   test= convert_page(current);
   find_structure(test);
   free(test);
@@ -286,7 +287,7 @@ void take_one_screenshot(void) {
   
   raise_and_get_details();
   sync_after_input();
-  snapshot(&current);
+  wait_for_stability(&current,0,0);
   page_images[0]= convert_page(current);
   npages= 1;
 }