Index: trunk/core/levent.c
===================================================================
--- trunk/core/levent.c	(revision 991)
+++ trunk/core/levent.c	(revision 992)
@@ -2,80 +2,76 @@
 #include "stdlib.h"
 #include "levent.h"
-/* function dealing with "logical events"*/
-unsigned levent_index_for_name(const char *name)
-{
-  unsigned i;
-  // TODO could check for id=-1 or id=0, both show up at end of table ?
-  for (i=0; levent_table[i].name; i++) {
-    // case insensitive might be better
-    if (strcmp(levent_table[i].name,name) == 0) {
-        return i;
+
+// functions dealing with "logical events"
+
+unsigned levent_index_for_name(const char *name) {
+    unsigned i;
+    // TODO could check for id=-1 or id=0, both show up at end of table ?
+    for (i=0; levent_table[i].name; i++) {
+        // case insensitive might be better
+        if (strcmp(levent_table[i].name,name) == 0) {
+            return i;
+        }
     }
-  }
-  return LEVENT_INVALID_INDEX;
+    return LEVENT_INVALID_INDEX;
 }
 
-unsigned levent_index_for_id(unsigned id)
-{
-  unsigned i;
-  // TODO could check for id=-1 or id=0, both show up at end of table ?
-  for (i=0; levent_table[i].name; i++) {
-    // case insensitive might be better
-    if (id == levent_table[i].id) {
-        return i;
+unsigned levent_index_for_id(unsigned id) {
+    unsigned i;
+    // TODO could check for id=-1 or id=0, both show up at end of table ?
+    for (i=0; levent_table[i].name; i++) {
+        // case insensitive might be better
+        if (id == levent_table[i].id) {
+            return i;
+        }
     }
-  }
-  return LEVENT_INVALID_INDEX;
+    return LEVENT_INVALID_INDEX;
 }
 
-unsigned levent_count(void)
-{
-  static unsigned num_levents = 0;
-  if(!num_levents) {
-    levent_def *ev;
-    // TODO could check for id=-1 or id=0, both show up at end of table ?
-    for (ev = levent_table; ev->name; ev++) {
-      num_levents++;
+unsigned levent_count(void) {
+    static unsigned num_levents = 0;
+    if(!num_levents) {
+        levent_def *ev;
+        // TODO could check for id=-1 or id=0, both show up at end of table ?
+        for (ev = levent_table; ev->name; ev++) {
+            num_levents++;
+        }
     }
-  }
-  return num_levents;
+    return num_levents;
 }
 
-unsigned levent_id_for_name(const char *name)
-{
-  unsigned i = levent_index_for_name(name);
-  if (i!=LEVENT_INVALID_INDEX)
-    return levent_table[i].id;
-  else
-    return 0; // or -1 ? both appear at the end of the event list
+unsigned levent_id_for_name(const char *name) {
+    unsigned i = levent_index_for_name(name);
+    if (i!=LEVENT_INVALID_INDEX)
+        return levent_table[i].id;
+    else
+        return 0; // or -1 ? both appear at the end of the event list
 }
 
-const char * levent_name_for_id(unsigned id)
-{
-  unsigned i = levent_index_for_id(id);
-  if (i!=LEVENT_INVALID_INDEX)
-    return levent_table[i].name;
-  else
-    return NULL;
+const char * levent_name_for_id(unsigned id) {
+    unsigned i = levent_index_for_id(id);
+    if (i!=LEVENT_INVALID_INDEX)
+        return levent_table[i].name;
+    else
+        return NULL;
 }
 
 // note, slow linear search every time
-int levent_post_to_ui_by_name(const char *name)
-{
-	unsigned id=levent_id_for_name(name);
-	if(id) {
-		PostLogicalEventToUI(id,0);
-		return 1;
-	}
-	return 0;
+int levent_post_to_ui_by_name(const char *name) {
+    unsigned id=levent_id_for_name(name);
+    if(id) {
+        PostLogicalEventToUI(id,0);
+        return 1;
+    }
+    return 0;
 }
 
 void levent_set_record(void) {
-	levent_post_to_ui_by_name("PressRecButton");
-	levent_post_to_ui_by_name("UnpressRecButton");
+    levent_post_to_ui_by_name("PressRecButton");
+    levent_post_to_ui_by_name("UnpressRecButton");
 }
 
 void levent_set_play(void) {
-	levent_post_to_ui_by_name("PressPBButton");
-	levent_post_to_ui_by_name("UnpressPBButton");
+    levent_post_to_ui_by_name("PressPBButton");
+    levent_post_to_ui_by_name("UnpressPBButton");
 }
Index: trunk/core/gui_space.c
===================================================================
--- trunk/core/gui_space.c	(revision 991)
+++ trunk/core/gui_space.c	(revision 992)
@@ -18,40 +18,40 @@
 }
 
-static void gui_space_draw_spacebar_horizontal () {
+static void gui_space_draw_spacebar_horizontal() {
     coord x;
     color cl = conf.space_color;
     int perc = get_space_perc(),height = 2;
     float size = 0;
-    if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 2){
-    cl = conf.space_color;
-    }
-       // space icon / bar
+    if (conf.space_warn_type == 0) {
+        cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 1) {
+        cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 2) {
+        cl = conf.space_color;
+    }
+    // space icon / bar
     height = conf.space_bar_width+1;
-    if (conf.space_bar_size == 0){
-    size = screen_width/4-4;
-           if (conf.space_hor_pos.x>(screen_width-size)){
+    if (conf.space_bar_size == 0) {
+        size = screen_width/4-4;
+        if (conf.space_hor_pos.x>(screen_width-size)) {
             conf.space_hor_pos.x = screen_width-size;
-        }    
-    }
-    if (conf.space_bar_size == 1){
-    size = screen_width/2-4;
-           if (conf.space_hor_pos.x>(screen_width-size)){
+        }
+    }
+    if (conf.space_bar_size == 1) {
+        size = screen_width/2-4;
+        if (conf.space_hor_pos.x>(screen_width-size)) {
             conf.space_hor_pos.x = screen_width-size;
         }
     }
-     if (conf.space_bar_size == 2){
-    size = screen_width-4;
-        if (conf.space_hor_pos.x>(screen_width-size)){
+    if (conf.space_bar_size == 2) {
+        size = screen_width-4;
+        if (conf.space_hor_pos.x>(screen_width-size)) {
             conf.space_hor_pos.x = 0;
         }
     }
-    if (conf.space_hor_pos.y > (screen_height-height-3)){
-            conf.space_hor_pos.y = screen_height-height-3;
+    if (conf.space_hor_pos.y > (screen_height-height-3)) {
+        conf.space_hor_pos.y = screen_height-height-3;
     }
     draw_rect(conf.space_hor_pos.x+1,    conf.space_hor_pos.y+1,     conf.space_hor_pos.x+1+size+2, conf.space_hor_pos.y+1+height+1,  cl);
@@ -60,7 +60,7 @@
     draw_line(conf.space_hor_pos.x+1-1,    conf.space_hor_pos.y+1+height+2,  conf.space_hor_pos.x+1+size+3, conf.space_hor_pos.y+1+height+2,  COLOR_BLACK);  // b
     draw_line(conf.space_hor_pos.x+1+size+3, conf.space_hor_pos.y+1-1,   conf.space_hor_pos.x+1+size+3, conf.space_hor_pos.y+1+height+2,  COLOR_BLACK);  // r
-    
+
     // space bar fill
-        
+
     x=conf.space_hor_pos.x+size-(perc/(100/size));
     if (x<=conf.space_hor_pos.x+1) x=conf.space_hor_pos.x+1;
@@ -70,53 +70,51 @@
 }
 
-
-static void gui_space_draw_spacebar_vertical () {
+static void gui_space_draw_spacebar_vertical() {
     coord y;
     color cl = conf.space_color;
     int perc = get_space_perc(), width = 2;
     float size = 0;
-    if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 2){
-    cl = conf.space_color;
-    }
-    
-       // space icon / bar
+    if (conf.space_warn_type == 0) {
+        cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 1) {
+        cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 2) {
+        cl = conf.space_color;
+    }
+
+    // space icon / bar
     width = conf.space_bar_width+1;
-    if (conf.space_bar_size == 0){
-    size = screen_height/4-4;
-         if (conf.space_ver_pos.y>(screen_height-size)){
+    if (conf.space_bar_size == 0) {
+        size = screen_height/4-4;
+        if (conf.space_ver_pos.y>(screen_height-size)) {
             conf.space_ver_pos.y = screen_height-size;
         }
     }
-    if (conf.space_bar_size == 1){
-    size = screen_height/2-4;
-       if (conf.space_ver_pos.y>(screen_height-size)){
+    if (conf.space_bar_size == 1) {
+        size = screen_height/2-4;
+        if (conf.space_ver_pos.y>(screen_height-size)) {
             conf.space_ver_pos.y = screen_height-size;
         }
     }
-     if (conf.space_bar_size == 2){
-    size = screen_height-4;
-        if (conf.space_ver_pos.y>(screen_height-size)){
+    if (conf.space_bar_size == 2) {
+        size = screen_height-4;
+        if (conf.space_ver_pos.y>(screen_height-size)) {
             conf.space_ver_pos.y = 0;
         }
     }
-    if (conf.space_ver_pos.x > (screen_width-width-3)){
-            conf.space_ver_pos.x = screen_width-width-3;
+    if (conf.space_ver_pos.x > (screen_width-width-3)) {
+        conf.space_ver_pos.x = screen_width-width-3;
     }
     draw_rect(conf.space_ver_pos.x+1,    conf.space_ver_pos.y+1,     conf.space_ver_pos.x+1+width+1, conf.space_ver_pos.y+1+size+2,  cl);
-    draw_line(conf.space_ver_pos.x+1-1,    conf.space_ver_pos.y+1-1, conf.space_ver_pos.x+1-1,    conf.space_ver_pos.y+1+5, COLOR_BLACK);  // l
-    
-    draw_line(conf.space_ver_pos.x+1-1,    conf.space_ver_pos.y+1-1, conf.space_ver_pos.x+1+width+2,    conf.space_ver_pos.y+1-1, COLOR_BLACK);  // t
+    draw_line(conf.space_ver_pos.x+1-1,    conf.space_ver_pos.y+1-1, conf.space_ver_pos.x+1-1,    conf.space_ver_pos.y+1+5, COLOR_BLACK);   // l
+
+    draw_line(conf.space_ver_pos.x+1-1,    conf.space_ver_pos.y+1-1, conf.space_ver_pos.x+1+width+2,    conf.space_ver_pos.y+1-1, COLOR_BLACK);   // t
     draw_line(conf.space_ver_pos.x+1-1,    conf.space_ver_pos.y+1+size+3, conf.space_ver_pos.x+1+width+2,    conf.space_ver_pos.y+1+size+3, COLOR_BLACK);   // b
-    
-    draw_line(conf.space_ver_pos.x+1+width+2, conf.space_ver_pos.y+1-1,   conf.space_ver_pos.x+1+width+2, conf.space_ver_pos.y+1+size+3,  COLOR_BLACK);  // r
-    
+
+    draw_line(conf.space_ver_pos.x+1+width+2, conf.space_ver_pos.y+1-1,   conf.space_ver_pos.x+1+width+2, conf.space_ver_pos.y+1+size+3,  COLOR_BLACK);   // r
+
     // space bar fill
-        
     y=conf.space_ver_pos.y+size-(perc/(100/size));
     if (y<=conf.space_ver_pos.y+1) y=conf.space_ver_pos.y+1;
@@ -126,33 +124,33 @@
 }
 
-static void gui_space_draw_icon () {
+static void gui_space_draw_icon() {
     coord x;
     color cl = conf.space_color;
     int perc = get_space_perc();
-    if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 2){
-    cl = conf.space_color;
+    if (conf.space_warn_type == 0) {
+        cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 1) {
+        cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 2) {
+        cl = conf.space_color;
     }
     int i;
-    int le = 23;//length
-    int wi = 15;//width
- 
-    draw_line(conf.space_icon_pos.x+5,      conf.space_icon_pos.y,       conf.space_icon_pos.x+le,     conf.space_icon_pos.y,       COLOR_BLACK);  // outer top
-    draw_line(conf.space_icon_pos.x+6,      conf.space_icon_pos.y+1,     conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+1,     MAKE_COLOR(cl, cl));  // inner top
-    draw_line(conf.space_icon_pos.x,        conf.space_icon_pos.y+5,     conf.space_icon_pos.x,        conf.space_icon_pos.y+wi,    COLOR_BLACK);  // outer left
-    draw_line(conf.space_icon_pos.x+1,      conf.space_icon_pos.y+6,     conf.space_icon_pos.x+1,      conf.space_icon_pos.y+wi-1,  MAKE_COLOR(cl, cl));  // inner left
-    draw_line(conf.space_icon_pos.x,        conf.space_icon_pos.y+wi,    conf.space_icon_pos.x+le,     conf.space_icon_pos.y+wi,    COLOR_BLACK);  // outer bottom
-    draw_line(conf.space_icon_pos.x+1,      conf.space_icon_pos.y+wi-1,  conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+wi-1,  MAKE_COLOR(cl, cl));  // inner bottom
-    draw_line(conf.space_icon_pos.x+le,     conf.space_icon_pos.y,       conf.space_icon_pos.x+le,     conf.space_icon_pos.y+wi,    COLOR_BLACK);  // outer right
-    draw_line(conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+1,     conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+wi-1,  MAKE_COLOR(cl, cl));  // inner right
-    draw_line(conf.space_icon_pos.x+5,      conf.space_icon_pos.y,       conf.space_icon_pos.x,        conf.space_icon_pos.y+5,     COLOR_BLACK);  // edge
-    draw_line(conf.space_icon_pos.x+5,      conf.space_icon_pos.y+1,     conf.space_icon_pos.x+1,      conf.space_icon_pos.y+5,     MAKE_COLOR(cl, cl));  // edge
-    draw_line(conf.space_icon_pos.x+6,      conf.space_icon_pos.y+1,     conf.space_icon_pos.x+1,      conf.space_icon_pos.y+6,     MAKE_COLOR(cl, cl));  // edge
- 
+    int le = 23;    // length
+    int wi = 15;    // width
+
+    draw_line(conf.space_icon_pos.x+5,      conf.space_icon_pos.y,       conf.space_icon_pos.x+le,     conf.space_icon_pos.y,       COLOR_BLACK);          // outer top
+    draw_line(conf.space_icon_pos.x+6,      conf.space_icon_pos.y+1,     conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+1,     MAKE_COLOR(cl, cl));   // inner top
+    draw_line(conf.space_icon_pos.x,        conf.space_icon_pos.y+5,     conf.space_icon_pos.x,        conf.space_icon_pos.y+wi,    COLOR_BLACK);          // outer left
+    draw_line(conf.space_icon_pos.x+1,      conf.space_icon_pos.y+6,     conf.space_icon_pos.x+1,      conf.space_icon_pos.y+wi-1,  MAKE_COLOR(cl, cl));   // inner left
+    draw_line(conf.space_icon_pos.x,        conf.space_icon_pos.y+wi,    conf.space_icon_pos.x+le,     conf.space_icon_pos.y+wi,    COLOR_BLACK);          // outer bottom
+    draw_line(conf.space_icon_pos.x+1,      conf.space_icon_pos.y+wi-1,  conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+wi-1,  MAKE_COLOR(cl, cl));   // inner bottom
+    draw_line(conf.space_icon_pos.x+le,     conf.space_icon_pos.y,       conf.space_icon_pos.x+le,     conf.space_icon_pos.y+wi,    COLOR_BLACK);          // outer right
+    draw_line(conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+1,     conf.space_icon_pos.x+le-1,   conf.space_icon_pos.y+wi-1,  MAKE_COLOR(cl, cl));   // inner right
+    draw_line(conf.space_icon_pos.x+5,      conf.space_icon_pos.y,       conf.space_icon_pos.x,        conf.space_icon_pos.y+5,     COLOR_BLACK);          // edge
+    draw_line(conf.space_icon_pos.x+5,      conf.space_icon_pos.y+1,     conf.space_icon_pos.x+1,      conf.space_icon_pos.y+5,     MAKE_COLOR(cl, cl));   // edge
+    draw_line(conf.space_icon_pos.x+6,      conf.space_icon_pos.y+1,     conf.space_icon_pos.x+1,      conf.space_icon_pos.y+6,     MAKE_COLOR(cl, cl));   // edge
+
     // memory fill
     x=le-(perc*(le-3)/100)-2;
@@ -160,11 +158,11 @@
     if (x>2) draw_line(conf.space_icon_pos.x+x+1,    conf.space_icon_pos.y+2,     conf.space_icon_pos.x+le-2,   conf.space_icon_pos.y+2,     MAKE_COLOR(cl, cl));
     else     draw_line(conf.space_icon_pos.x+4,      conf.space_icon_pos.y+2,     conf.space_icon_pos.x+le-2,   conf.space_icon_pos.y+2,     MAKE_COLOR(cl, cl));
-    for(i=3;i<7;i++){                                                                                                                                               //          /--------------|
-        if (x>7-i) draw_pixel(conf.space_icon_pos.x+8-i,     conf.space_icon_pos.y+i,     COLOR_BLACK);                                                             //        /  1st for loop  |
-        if (x>7-i) draw_pixel(conf.space_icon_pos.x+x,       conf.space_icon_pos.y+i,     COLOR_BLACK);                                                             //      /__________________|
-        draw_line(conf.space_icon_pos.x+x+1,                 conf.space_icon_pos.y+i,     conf.space_icon_pos.x+le-2,     conf.space_icon_pos.y+i,     MAKE_COLOR(cl, cl));//     |                   |
-    }                                                                                                                                                               //     |     2nd for loop  |
-    for(i=7;i<wi-2;i++){                                                                                                                                            //     |                   |
-        if (x>1) draw_pixel(conf.space_icon_pos.x+2,         conf.space_icon_pos.y+i,     COLOR_BLACK);                                                             //     |-------------------|
+    for(i=3; i<7; i++) {                                                                                                                                                      //          /--------------|
+        if (x>7-i) draw_pixel(conf.space_icon_pos.x+8-i,     conf.space_icon_pos.y+i,     COLOR_BLACK);                                                                       //        /  1st for loop  |
+        if (x>7-i) draw_pixel(conf.space_icon_pos.x+x,       conf.space_icon_pos.y+i,     COLOR_BLACK);                                                                       //      /__________________|
+        draw_line(conf.space_icon_pos.x+x+1,                 conf.space_icon_pos.y+i,     conf.space_icon_pos.x+le-2,     conf.space_icon_pos.y+i,     MAKE_COLOR(cl, cl));   //     |                   |
+    }                                                                                                                                                                         //     |     2nd for loop  |
+    for(i=7; i<wi-2; i++) {                                                                                                                                                   //     |                   |
+        if (x>1) draw_pixel(conf.space_icon_pos.x+2,         conf.space_icon_pos.y+i,     COLOR_BLACK);                                                                       //     |-------------------|
         if (x>1) draw_pixel(conf.space_icon_pos.x+x,         conf.space_icon_pos.y+i,     COLOR_BLACK);
         draw_line(conf.space_icon_pos.x+x+1,                 conf.space_icon_pos.y+i,     conf.space_icon_pos.x+le-2,     conf.space_icon_pos.y+i,     MAKE_COLOR(cl, cl));
@@ -174,17 +172,16 @@
 }
 
-
-//-------------------------------------------------------------------
-static void gui_space_draw_percent(){
+//-------------------------------------------------------------------
+static void gui_space_draw_percent() {
     int perc = get_space_perc();
     color cl = conf.space_color;
-    if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 2){
-    cl = conf.space_color;
+    if (conf.space_warn_type == 0) {
+        cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 1) {
+        cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 2) {
+        cl = conf.space_color;
     }
     sprintf(osd_buf, "%3d%%", get_space_perc());
@@ -197,36 +194,35 @@
     int perc = get_space_perc();
     color cl = conf.space_color;
-    if (conf.space_warn_type == 0){
-        cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 1){
-        cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
-    }
-    if (conf.space_warn_type == 2){
-        cl = conf.space_color;
-    }
-  unsigned int freemb=GetFreeCardSpaceKb()/1024;
-  if (freemb < 10000) sprintf(osd_buf, "%3d%M",freemb);
-  else sprintf(osd_buf, "%3d%G",freemb/1024); // if 10 GiB or more free, print in GiB instead of MiB.
-  osd_buf[5]=0;
-  draw_string(conf.space_txt_pos.x, conf.space_txt_pos.y, osd_buf, cl);
-}
-
+    if (conf.space_warn_type == 0) {
+        cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 1) {
+        cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    }
+    if (conf.space_warn_type == 2) {
+        cl = conf.space_color;
+    }
+    unsigned int freemb=GetFreeCardSpaceKb()/1024;
+    if (freemb < 10000) sprintf(osd_buf, "%3d%M",freemb);
+    else sprintf(osd_buf, "%3d%G",freemb/1024);   // if 10 GiB or more free, print in GiB instead of MiB
+    osd_buf[5]=0;
+    draw_string(conf.space_txt_pos.x, conf.space_txt_pos.y, osd_buf, cl);
+}
 
 //-------------------------------------------------------------------
 
 void gui_space_draw_osd() {
-    if (conf.space_icon_show)   {
+    if (conf.space_icon_show) {
         gui_space_draw_icon();
     }
-    if (conf.space_perc_show)  {
+    if (conf.space_perc_show) {
         gui_space_draw_percent();
     } else if (conf.space_mb_show) {
         gui_space_draw_mb();
     }
-  if (conf.space_bar_show==1)  {
+    if (conf.space_bar_show==1) {
         gui_space_draw_spacebar_horizontal();
     }
-  if (conf.space_bar_show==2) {
+    if (conf.space_bar_show==2) {
         gui_space_draw_spacebar_vertical();
     }
Index: trunk/core/gui_debug.c
===================================================================
--- trunk/core/gui_debug.c	(revision 991)
+++ trunk/core/gui_debug.c	(revision 992)
@@ -18,5 +18,5 @@
 
 //-------------------------------------------------------------------
-#define SCREEN_COLOR            0xF7
+#define SCREEN_COLOR    0xF7
 
 //-------------------------------------------------------------------
@@ -44,6 +44,6 @@
     draw_txt_string(10, y+2, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
 
-//    sprintf(buf, "0x%lf", *((double*)addr));
-//    draw_txt_string(10, y+3, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+    //sprintf(buf, "0x%lf", *((double*)addr));
+    //draw_txt_string(10, y+3, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
 
     for (i=0; i<30; ++i) {
@@ -90,5 +90,4 @@
             gui_debug_draw_values(2, addr);
             gui_debug_draw_values(8, *((void**)addr));
-            
             conf.mem_view_addr_init = (long)addr;
 
@@ -107,6 +106,6 @@
         break;
     case KEY_UP:
-				debug_cont_update = !debug_cont_update;
-				debug_to_draw = 2;
+        debug_cont_update = !debug_cont_update;
+        debug_to_draw = 2;
         break;
     case KEY_LEFT:
@@ -126,5 +125,5 @@
         debug_to_draw = 2;
         break;
-    case KEY_ZOOM_IN: // reduce step
+    case KEY_ZOOM_IN:    // reduce step
         switch (step) {
             case 0x00000010: step = 0x0000004; break;
@@ -132,7 +131,7 @@
             default: step>>=4; break;
         }
-				debug_to_draw = 2;
-				break;
-		case KEY_ZOOM_OUT: // increase step
+        debug_to_draw = 2;
+        break;
+    case KEY_ZOOM_OUT:    // increase step
         switch (step) {
             case 0x00000004: step = 0x00000010; break;
@@ -140,6 +139,6 @@
             default: step<<=4; break;
         }
-				debug_to_draw = 2;
-				break;
+        debug_to_draw = 2;
+        break;
     }
 }
Index: trunk/core/gui_batt.c
===================================================================
--- trunk/core/gui_batt.c	(revision 991)
+++ trunk/core/gui_batt.c	(revision 992)
@@ -49,5 +49,5 @@
     draw_line(conf.batt_icon_pos.x+3-2,    conf.batt_icon_pos.y+1+11,  conf.batt_icon_pos.x+3+25+2, conf.batt_icon_pos.y+1+11,  COLOR_BLACK);  // b
     draw_line(conf.batt_icon_pos.x+3+25+2, conf.batt_icon_pos.y+1-1,   conf.batt_icon_pos.x+3+25+2, conf.batt_icon_pos.y+1+10,  COLOR_BLACK);  // r
-    
+
     // battery fill
     x=conf.batt_icon_pos.x+3+1+25-(perc/4);
@@ -59,5 +59,5 @@
 
 //-------------------------------------------------------------------
-static void gui_batt_draw_charge(){
+static void gui_batt_draw_charge() {
     int perc = get_batt_perc();
     color cl = (perc<=10)?conf.osd_color_warn:conf.osd_color;
@@ -84,5 +84,5 @@
         gui_batt_draw_volts();
     }
-    
+
     if (conf.batt_icon_show) {
         gui_batt_draw_icon();
Index: trunk/core/main.c
===================================================================
--- trunk/core/main.c	(revision 991)
+++ trunk/core/main.c	(revision 992)
@@ -9,49 +9,42 @@
 #include "motion_detector.h"
 #ifdef OPT_EDGEOVERLAY
-	#include "edgeoverlay.h"
+    #include "edgeoverlay.h"
 #endif
 static int raw_need_postprocess;
 static volatile int spytask_can_start;
 
-void core_hook_task_create(void *tcb)
-{
+void core_hook_task_create(void *tcb) {
 }
 
-void core_hook_task_delete(void *tcb)
-{
-char *name = (char*)(*(long*)((char*)tcb+0x34));
- if (strcmp(name,"tInitFileM")==0) core_spytask_can_start();
+void core_hook_task_delete(void *tcb) {
+    char *name = (char*)(*(long*)((char*)tcb+0x34));
+    if (strcmp(name,"tInitFileM")==0) core_spytask_can_start();
 }
 
-
-long core_get_noise_reduction_value()
-{
+long core_get_noise_reduction_value() {
     return conf.raw_nr;
 }
 
-
-void dump_memory()
-{
+void dump_memory() {
     int fd;
     static int cnt=1;
     static char fn[32];
 
-
     started();
-        mkdir("A/DCIM");
-        mkdir("A/DCIM/100CANON");
-	sprintf(fn, "A/DCIM/100CANON/CRW_%04d.JPG", cnt++);
-	fd = open(fn, O_WRONLY|O_CREAT, 0777);
-	if (fd) {
-#ifdef CAMERA_ixus65_sd630 // Zero is not readable on ixus65!
-	    write(fd, (int*)0xFFFF0000, 4);
-	    write(fd, (int*)4, 0x1900-4);
+    mkdir("A/DCIM");
+    mkdir("A/DCIM/100CANON");
+    sprintf(fn, "A/DCIM/100CANON/CRW_%04d.JPG", cnt++);
+    fd = open(fn, O_WRONLY|O_CREAT, 0777);
+    if (fd) {
+#ifdef CAMERA_ixus65_sd630    // Zero is not readable on ixus65!
+        write(fd, (int*)0xFFFF0000, 4);
+        write(fd, (int*)4, 0x1900-4);
 #else
-	    write(fd, (void*)0, 0x1900);
+        write(fd, (void*)0, 0x1900);
 #endif
-// TODO actual memory size is larger than 32 MB on many cameras!
-	    write(fd, (void*)0x1900, 32*1024*1024-0x1900);
-	    close(fd);
-	}
+        // TODO actual memory size is larger than 32 MB on many cameras!
+        write(fd, (void*)0x1900, 32*1024*1024-0x1900);
+        close(fd);
+    }
     vid_bitmap_refresh();
     finished();
@@ -60,16 +53,14 @@
 static volatile long raw_data_available;
 
-/* called from another process */
-void core_rawdata_available()
-{
+// called from another process
+void core_rawdata_available() {
     raw_data_available = 1;
 }
 
 void core_spytask_can_start() {
-        spytask_can_start = 1;
+    spytask_can_start = 1;
 }
 
-void core_spytask()
-{
+void core_spytask() {
     int cnt = 1;
     int i=0;
@@ -80,5 +71,5 @@
 
 #ifdef CAM_CHDK_PTP
-	init_chdk_ptp_task();
+    init_chdk_ptp_task();
 #endif
 
@@ -114,39 +105,35 @@
     auto_started = 0;
 
-    if (conf.script_startup==1) script_autostart();				// remote autostart
-	if (conf.script_startup==2) {
-		conf.script_startup=0;
-		conf_save();
-		script_autostart();
-	}
-    while (1){
+    if (conf.script_startup==1) script_autostart();    // remote autostart
+    if (conf.script_startup==2) {
+        conf.script_startup=0;
+        conf_save();
+        script_autostart();
+    }
 
-	if (raw_data_available){
+    while (1) {
+        if (raw_data_available) {
             raw_need_postprocess = raw_savefile();
-	    hook_raw_save_complete();
-	    raw_data_available = 0;
-	    continue;
-	}
+            hook_raw_save_complete();
+            raw_data_available = 0;
+            continue;
+        }
 
-	if (state_shooting_progress != SHOOTING_PROGRESS_PROCESSING) {
-	    if (((cnt++) & 3) == 0)
-	        gui_redraw();
+        if (state_shooting_progress != SHOOTING_PROGRESS_PROCESSING) {
+            if (((cnt++) & 3) == 0)
+                gui_redraw();
 
-	    histogram_process();
+            histogram_process();
 #ifdef OPT_EDGEOVERLAY
-        if(conf.edge_overlay_thresh && conf.edge_overlay_enable) edge_overlay();
+            if(conf.edge_overlay_thresh && conf.edge_overlay_enable) edge_overlay();
 #endif
-	}
+        }
 
-	if ((state_shooting_progress == SHOOTING_PROGRESS_PROCESSING) && (!shooting_in_progress())) {
-	    state_shooting_progress = SHOOTING_PROGRESS_DONE;
+        if ((state_shooting_progress == SHOOTING_PROGRESS_PROCESSING) && (!shooting_in_progress())) {
+            state_shooting_progress = SHOOTING_PROGRESS_DONE;
             if (raw_need_postprocess) raw_postprocess();
         }
 
-	msleep(20);
+        msleep(20);
     }
 }
-
-
-
-
