From: Grazvydas Ignotas Date: Sat, 27 Aug 2011 13:56:04 +0000 (+0300) Subject: get rid of EOL spaces X-Git-Tag: sz_beta3~38 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-libraries.git;a=commitdiff_plain;h=8290d9ca651c95ff7f5108b7019987162293287c get rid of EOL spaces Some editors remove them automatically, and people start sending patches with such changes mixed in the patch with actual changes, which makes those patches hard to review, so let's just sed out those spaces. --- diff --git a/apps/pndevmapperd.c b/apps/pndevmapperd.c index 3f860ed..273a43c 100644 --- a/apps/pndevmapperd.c +++ b/apps/pndevmapperd.c @@ -230,7 +230,7 @@ int main ( int argc, char *argv[] ) { // umask umask ( 022 ); // emitted files can be rwxr-xr-x - + } // set up daemon /* hmm, seems to not like working right after boot.. do we depend on another daemon or @@ -861,7 +861,7 @@ unsigned char set_next_alarm ( unsigned int secs, unsigned int usecs ) { // sucks return ( 0 ); } - + return ( 1 ); } diff --git a/apps/pndnotifyd.c b/apps/pndnotifyd.c index 346ab25..fd1c1a1 100644 --- a/apps/pndnotifyd.c +++ b/apps/pndnotifyd.c @@ -197,7 +197,7 @@ int main ( int argc, char *argv[] ) { // umask umask ( 022 ); // emitted files can be rwxr-xr-x - + } // set up daemon // wait for a user to be logged in - we should probably get hupped when a user logs in, so we can handle diff --git a/lib/pnd_apps.c b/lib/pnd_apps.c index c5eec2f..ad5cf8c 100644 --- a/lib/pnd_apps.c +++ b/lib/pnd_apps.c @@ -149,7 +149,7 @@ unsigned char pnd_apps_exec_disco ( char *pndrun, pnd_disco_t *app, // -s startdir // -b name for the appdir - if ( ( strcmp ( argv [ i ], "-a" ) == 0 ) || + if ( ( strcmp ( argv [ i ], "-a" ) == 0 ) || ( strcmp ( argv [ i ], "-p" ) == 0 ) || ( strcmp ( argv [ i ], "-e" ) == 0 ) || ( strcmp ( argv [ i ], "-s" ) == 0 ) || @@ -181,7 +181,7 @@ unsigned char pnd_apps_exec_disco ( char *pndrun, pnd_disco_t *app, } else { // child, do it execv ( pndrun, argv ); - } + } // by definition, either error occurred or we are the original application. diff --git a/lib/pnd_conf.c b/lib/pnd_conf.c index 88d0c46..9c4f31f 100644 --- a/lib/pnd_conf.c +++ b/lib/pnd_conf.c @@ -233,7 +233,7 @@ pnd_conf_handle pnd_conf_fetch_by_path ( char *fullpath ) { } // key or key/value? } // section or key/value line? - + } // while // clean up a trifle diff --git a/lib/pnd_desktop.c b/lib/pnd_desktop.c index 349056d..84e420a 100644 --- a/lib/pnd_desktop.c +++ b/lib/pnd_desktop.c @@ -526,7 +526,7 @@ int pnd_map_dotdesktop_categories ( pnd_conf_handle c, char *target_buffer, unsi { match = pnd_map_dotdesktop_category ( c, t ); } - + if ( match ) { strncat ( target_buffer, match, len ); len -= strlen ( target_buffer ); @@ -552,7 +552,7 @@ int pnd_map_dotdesktop_categories ( pnd_conf_handle c, char *target_buffer, unsi { match = pnd_map_dotdesktop_category ( c, t ); } - + if ( match ) { if ( target_buffer [ 0 ] != '\0' && len > 0 ) { strcat ( target_buffer, ";" ); @@ -581,7 +581,7 @@ int pnd_map_dotdesktop_categories ( pnd_conf_handle c, char *target_buffer, unsi { match = pnd_map_dotdesktop_category ( c, t ); } - + if ( match ) { strncat ( target_buffer, match, len ); len -= strlen ( target_buffer ); @@ -607,7 +607,7 @@ int pnd_map_dotdesktop_categories ( pnd_conf_handle c, char *target_buffer, unsi { match = pnd_map_dotdesktop_category ( c, t ); } - + if ( match ) { if ( target_buffer [ 0 ] != '\0' && len > 0 ) { strcat ( target_buffer, ";" ); diff --git a/lib/pnd_discovery.c b/lib/pnd_discovery.c index b6627d2..84376e9 100644 --- a/lib/pnd_discovery.c +++ b/lib/pnd_discovery.c @@ -258,10 +258,10 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb, p -> appdata_dirname = strdup ( pnd_pxml_get_appdata_dirname ( pxmlh ) ); } if ( pnd_pxml_get_clockspeed ( pxmlh ) ) { - p -> clockspeed = strdup ( pnd_pxml_get_clockspeed ( pxmlh ) ); + p -> clockspeed = strdup ( pnd_pxml_get_clockspeed ( pxmlh ) ); } if ( pnd_pxml_get_startdir ( pxmlh ) ) { - p -> startdir = strdup ( pnd_pxml_get_startdir ( pxmlh ) ); + p -> startdir = strdup ( pnd_pxml_get_startdir ( pxmlh ) ); } // category kruft if ( pnd_pxml_get_main_category ( pxmlh ) ) { diff --git a/lib/pnd_io_evdev.c b/lib/pnd_io_evdev.c index 98a8550..e88870a 100644 --- a/lib/pnd_io_evdev.c +++ b/lib/pnd_io_evdev.c @@ -171,7 +171,7 @@ unsigned char pnd_evdev_catchup ( unsigned char blockp ) { ret = select ( maxfd + 1, &fdset, NULL, NULL, ptv ); - if ( ret < 0 ) { + if ( ret < 0 ) { return ( 0 ); // something bad } else if ( ret == 0 ) { return ( 1 ); // all good, nothing here diff --git a/lib/pnd_io_gpio.c b/lib/pnd_io_gpio.c index d8824aa..0e666ef 100755 --- a/lib/pnd_io_gpio.c +++ b/lib/pnd_io_gpio.c @@ -90,7 +90,7 @@ void PND_ReadEvents ( int fd, int device ) { PND_CheckEvent ( &ev[i], device ); } } - + } // got fd? return; @@ -110,7 +110,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { switch( event->code ) { case KEY_UP: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_up] = 1; } else { GLES2D_Pad[pke_pad_up] = 0; @@ -118,7 +118,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case KEY_DOWN: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_down] = 1; } else { GLES2D_Pad[pke_pad_down] = 0; @@ -126,7 +126,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case KEY_LEFT: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_left] = 1; } else { GLES2D_Pad[pke_pad_left] = 0; @@ -134,7 +134,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case KEY_RIGHT: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_right] = 1; } else { GLES2D_Pad[pke_pad_right] = 0; @@ -142,7 +142,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case KEY_MENU: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_menu] = 1; } else { GLES2D_Pad[pke_pad_menu] = 0; @@ -158,7 +158,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case BTN_X: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_x] = 1; } else { GLES2D_Pad[pke_pad_x] = 0; @@ -166,7 +166,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case BTN_Y: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_y] = 1; } else { GLES2D_Pad[pke_pad_y] = 0; @@ -174,7 +174,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case BTN_A: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_a] = 1; } else { GLES2D_Pad[pke_pad_a] = 0; @@ -182,7 +182,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case BTN_B: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_b] = 1; } else { GLES2D_Pad[pke_pad_b] = 0; @@ -190,7 +190,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case BTN_TL: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_l] = 1; } else { GLES2D_Pad[pke_pad_l] = 0; @@ -198,7 +198,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; case BTN_TR: - if ( event->value ) { + if ( event->value ) { GLES2D_Pad[pke_pad_r] = 1; } else { GLES2D_Pad[pke_pad_r] = 0; @@ -209,7 +209,7 @@ void PND_CheckEvent ( struct input_event *event, int device ) { break; } break; - + case EV_ABS: switch ( device ) { @@ -221,12 +221,12 @@ void PND_CheckEvent ( struct input_event *event, int device ) { if( value > 0 ) { value = 1; } else if( value < 0 ) { - value = 1; + value = 1; } } else { } } - + if( event->code == ABS_Y ) { //printf( "nub1 y %3d\n", value ); if( abs(value) > NUB1_CUTOFF ) { @@ -247,12 +247,12 @@ void PND_CheckEvent ( struct input_event *event, int device ) { if( value > 0 ) { value = 1; } else if( value < 0 ) { - value = 1; + value = 1; } } else { } } - + if(event->code == ABS_Y) { //printf( "nub2 y %3d\n", value ); if( abs(value) > NUB2_CUTOFF ) { @@ -332,7 +332,7 @@ int PND_OpenEventDeviceByName ( char device_name[] ) { ioctl(fd, EVIOCGNAME(sizeof(dev_name)), dev_name); printf("Input device name: \"%s\"\n", dev_name); - + return fd; } diff --git a/lib/pnd_pndfiles.c b/lib/pnd_pndfiles.c index 39fac77..3200442 100644 --- a/lib/pnd_pndfiles.c +++ b/lib/pnd_pndfiles.c @@ -204,7 +204,7 @@ static unsigned char pnd_pnd_mountie ( char *pndrun, char *fullpath, char *uniqu } else { // child, do it execv ( pndrun, argv ); - } + } // wait until mountscript actually completes int status = 0; diff --git a/lib/pnd_pxml.c b/lib/pnd_pxml.c index f2cc4f6..3a9406d 100644 --- a/lib/pnd_pxml.c +++ b/lib/pnd_pxml.c @@ -211,7 +211,7 @@ void pnd_pxml_delete ( pnd_pxml_handle h ) { } void pnd_pxml_set_app_name ( pnd_pxml_handle h, char *v ) { - /* + /* * Please do not use this function if it can be avoided; it is only here for compatibility. * The function might fail on low memory, and there's no way for the user to know when this happens. */ diff --git a/lib/pnd_tinyxml.cpp b/lib/pnd_tinyxml.cpp index 5867135..8bb7436 100644 --- a/lib/pnd_tinyxml.cpp +++ b/lib/pnd_tinyxml.cpp @@ -114,7 +114,7 @@ unsigned char pnd_pxml_parse_descriptions(const TiXmlHandle hRoot, pnd_pxml_t *a app->descriptions_alloc_c = 4; //TODO: adjust this based on how many descriptions a PXML usually has. Power of 2. app->descriptions = (pnd_localized_string_t *)malloc(sizeof(pnd_localized_string_t) * app->descriptions_alloc_c); - if (!app->descriptions) + if (!app->descriptions) { app->descriptions_alloc_c = 0; return (0); //errno = NOMEM @@ -310,7 +310,7 @@ unsigned char pnd_pxml_parse ( const char *pFilename, char *buffer, unsigned int { app->previewpic2 = pnd_pxml_get_attribute(pElem, PND_PXML_ATTRNAME_PREVPICSRC); } - } + } } //previewpic //The author info: @@ -347,7 +347,7 @@ unsigned char pnd_pxml_parse ( const char *pFilename, char *buffer, unsigned int i = 0; //Goes through all the top-level categories and their sub-categories. i helps limit these to 2. - for (pElem = pElem->FirstChildElement(PND_PXML_ENAME_CAT); pElem && i < 2; + for (pElem = pElem->FirstChildElement(PND_PXML_ENAME_CAT); pElem && i < 2; pElem = pElem->NextSiblingElement(PND_PXML_ENAME_CAT), i++) { //TODO: Fix pnd_pxml_t so that there can be more than 2 category 'trees' and more than 2 subcategories. Then this can be removed. @@ -396,7 +396,7 @@ unsigned char pnd_pxml_parse ( const char *pFilename, char *buffer, unsigned int { i = 0; //Go through all associations. i serves as index; since the format only supports 3 associations we need to keep track of the number. - for (pElem = pElem->FirstChildElement(PND_PXML_ENAME_ASSOC); pElem && i < 3; + for (pElem = pElem->FirstChildElement(PND_PXML_ENAME_ASSOC); pElem && i < 3; pElem = pElem->NextSiblingElement(PND_PXML_ENAME_ASSOC), i++) { char *name = pnd_pxml_get_attribute(pElem, PND_PXML_ATTRNAME_ASSOCNAME); @@ -434,13 +434,13 @@ unsigned char pnd_pxml_parse ( const char *pFilename, char *buffer, unsigned int //Performance related things (aka: Clockspeed XD): pElem = hRoot.FirstChild(PND_PXML_ENAME_CLOCK).Element(); if (pElem) - { + { app->clockspeed = pnd_pxml_get_attribute(pElem, PND_PXML_ATTRNAME_CLOCKFREQ); } // Package pElem = hRoot.FirstChild ( PND_PXML_ENAME_PACKAGE ).Element(); - if ( pElem ) { + if ( pElem ) { app -> package_name = pnd_pxml_get_attribute ( pElem, PND_PXML_ATTRNAME_PACKAGE_NAME ); app -> package_release_date = pnd_pxml_get_attribute ( pElem, PND_PXML_ATTRNAME_PACKAGE_DATE ); } @@ -458,7 +458,7 @@ unsigned char pnd_pxml_parse ( const char *pFilename, char *buffer, unsigned int } while ( ( pElem = pElem -> NextSiblingElement ( PND_PXML_ENAME_MKDIR ) ) ) { - + if ( ( t = pnd_pxml_get_attribute(pElem, PND_PXML_ATTRNAME_MKDIRPATH) ) ) { char *foo = (char*) malloc ( strlen ( app -> mkdir_sp ) + strlen ( t ) + 1 /*:*/ + 1 /*\0*/ ); diff --git a/minimenu/mmcache.c b/minimenu/mmcache.c index 3ebb104..9b0c8bc 100644 --- a/minimenu/mmcache.c +++ b/minimenu/mmcache.c @@ -158,9 +158,9 @@ unsigned char cache_preview ( pnd_disco_t *app, unsigned int maxwidth, unsigned } // set up target filename to copy snprintf ( buffer, PATH_MAX, "%s/%s/%s.png", cacheoutpath, cache_path, app -> unique_id ); - pnd_log ( pndn_debug, "Found free space to cache preview to here: %s", buffer ); + pnd_log ( pndn_debug, "Found free space to cache preview to here: %s", buffer ); if ( ! pnd_filecopy ( filepath, buffer ) ) { - pnd_log ( pndn_error, "ERROR: Copying preview from %s to %s", filepath, buffer ); + pnd_log ( pndn_error, "ERROR: Copying preview from %s to %s", filepath, buffer ); } } else { pnd_log ( pndn_warning, "WARN: Couldn't find a device to cache preview to.\n" ); diff --git a/minimenu/mmcat.c b/minimenu/mmcat.c index ab3e9d4..9600d33 100644 --- a/minimenu/mmcat.c +++ b/minimenu/mmcat.c @@ -424,7 +424,7 @@ unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco if ( parentcatname ) { if ( ( ! fdcat -> parent_cat ) || ( ! fdpcat ) ) - { + { // child cat points to a different parent than requested parent! cat_is_clean = 0; pnd_log ( pndn_warning, "PXML Fail %s: Cat request %s (parent %s) -> cat wants to be child of a cat which FD says is the wrong parent (1)\n", app -> title_en ? app -> title_en : "no name?", catname, parentcatname ? parentcatname : "n/a" ); @@ -853,15 +853,15 @@ unsigned int category_count ( unsigned int filter_mask ) { int category_index ( char *catname ) { unsigned char i; - + for ( i = 0; i < g_categorycount; i++ ) { - + if ( strcasecmp ( g_categories [ i ] -> catname, catname ) == 0 ) { return ( i ); } - + } - + return ( -1 ); } diff --git a/minimenu/mmconf.c b/minimenu/mmconf.c index 3f2fac2..c038e2e 100644 --- a/minimenu/mmconf.c +++ b/minimenu/mmconf.c @@ -682,7 +682,7 @@ unsigned char conf_write ( pnd_conf_handle h, char *fullpath ) { // does item begin with app or tab tag? char *k = pnd_box_get_key ( v ); - if ( k && + if ( k && ( strncasecmp ( k, "appshow.", 8 ) == 0 || strncasecmp ( k, "tabshow.", 8 ) == 0 ) ) @@ -818,7 +818,7 @@ void conf_reset_to_default ( pnd_conf_handle h ) { // does item begin with app or tab tag? char *k = pnd_box_get_key ( v ); - if ( k && + if ( k && ( strncasecmp ( k, "appshow.", 8 ) == 0 || strncasecmp ( k, "tabshow.", 8 ) == 0 ) ) diff --git a/minimenu/mmenu.c b/minimenu/mmenu.c index 6ada53f..be38fb0 100644 --- a/minimenu/mmenu.c +++ b/minimenu/mmenu.c @@ -448,7 +448,7 @@ static unsigned int is_dir_empty ( char *fullpath ) { } else { // something else came in, so dir must not be empty closedir ( d ); - return ( 0 ); + return ( 0 ); } de = readdir ( d ); @@ -663,7 +663,7 @@ void applications_scan ( void ) { ( pnd_pxml_get_x11 ( iter -> option_no_x11 ) == pnd_pxml_x11_required && g_x11_present == 1 ) ) { - + if ( iter -> title_en == NULL || iter -> title_en [ 0 ] == '\0' ) { // null title; just skip it. } else { @@ -836,7 +836,7 @@ void emit_and_run ( char *buffer ) { } else { // child, do it execl ( "/bin/sh", "/bin/sh", "-c", buffer + strlen(MM_RUN) + 1, (char*) NULL ); - } + } return; } diff --git a/minimenu/mmui.c b/minimenu/mmui.c index 0c9a5f1..25a9f3b 100644 --- a/minimenu/mmui.c +++ b/minimenu/mmui.c @@ -3434,7 +3434,7 @@ void ui_menu_context ( mm_appref_t *a ) { context_alive = 0; // nolonger visible, so lets just get out } - + break; case context_app_recategorize: @@ -3862,7 +3862,7 @@ unsigned char ui_menu_get_text_line ( char *title, char *footer, char *initialva } // while waiting for input } // while - + return ( 0 ); } diff --git a/minimenu/mmwrapper.c b/minimenu/mmwrapper.c index 63749f1..2b50929 100644 --- a/minimenu/mmwrapper.c +++ b/minimenu/mmwrapper.c @@ -151,7 +151,7 @@ int main ( int argc, char *argv[] ) { // umask umask ( 022 ); // emitted files can be rwxr-xr-x - + } // set up daemon // check frontend diff --git a/test/rawpxmltest.c b/test/rawpxmltest.c index 06545ba..202d226 100644 --- a/test/rawpxmltest.c +++ b/test/rawpxmltest.c @@ -9,7 +9,7 @@ //Used like a unit test, almost int main (int argc, char **argv) { - if (argc != 2) + if (argc != 2) { printf("Wrong nr of args.\nUsage: %s \n", argv[0]); return 1; diff --git a/testdata/scripts/pnd_make.sh b/testdata/scripts/pnd_make.sh index 0c03e81..b182819 100755 --- a/testdata/scripts/pnd_make.sh +++ b/testdata/scripts/pnd_make.sh @@ -272,7 +272,7 @@ then cecho "ERROR: Your squashfs version is older then version 4, please upgrade to 4.0 or later" $red exit 1 fi - mksquashfs $FOLDER $PNDNAME.iso -nopad -no-recovery + mksquashfs $FOLDER $PNDNAME.iso # -nopad -no-recovery else check_for_tool mkisofs mkisofs -o $PNDNAME.iso -R $FOLDER