X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Fjim.h;h=a5ae150171f897f3e9dc5e8be0ae4a3e1a06d480;hp=f52fda14c1a05dbff3550b100a64fb6dfc09974f;hb=fb1a9b2cb2f844a17d26dfeb3d26849364d93e26;hpb=9a5acdc161372b7f2923877f6b9b034d4031b389 diff --git a/src/helper/jim.h b/src/helper/jim.h index f52fda14c1..a5ae150171 100644 --- a/src/helper/jim.h +++ b/src/helper/jim.h @@ -241,7 +241,7 @@ typedef struct Jim_HashTableIterator { entry->val = (ht)->type->valDup((ht)->privdata, _val_); \ else \ entry->val = (_val_); \ -} while(0) +} while (0) #define Jim_FreeEntryKey(ht, entry) \ if ((ht)->type->keyDestructor) \ @@ -252,7 +252,7 @@ typedef struct Jim_HashTableIterator { entry->key = (ht)->type->keyDup((ht)->privdata, _key_); \ else \ entry->key = (_key_); \ -} while(0) +} while (0) #define Jim_CompareHashKeys(ht, key1, key2) \ (((ht)->type->keyCompare) ? \ @@ -555,7 +555,7 @@ typedef struct Jim_Interp { Jim_IncrRefCount(_resultObjPtr_); \ Jim_DecrRefCount(i,(i)->result); \ (i)->result = _resultObjPtr_; \ -} while(0) +} while (0) /* Reference structure. The interpreter pointer is held within privdata member in HashTable */ #define JIM_REFERENCE_TAGLEN 7 /* The tag is fixed-length, because the reference @@ -563,7 +563,7 @@ typedef struct Jim_Interp { typedef struct Jim_Reference { Jim_Obj *objPtr; Jim_Obj *finalizerCmdNamePtr; - char tag[JIM_REFERENCE_TAGLEN+1]; + char tag[JIM_REFERENCE_TAGLEN + 1]; } Jim_Reference; /** Name Value Pairs, aka: NVP @@ -575,10 +575,10 @@ typedef struct Jim_Reference { * known string, or there may be multiple strings (aliases) that mean then same * thing. * - * An NVP Table is terminated with ".name=NULL". + * An NVP Table is terminated with ".name = NULL". * * During the 'name2value' operation, if no matching string is found - * the pointer to the terminal element (with p->name==NULL) is returned. + * the pointer to the terminal element (with p->name == NULL) is returned. * * Example: * \code @@ -966,7 +966,7 @@ JIM_STATIC const char *JIM_API( Jim_Debug_ArgvString )( Jim_Interp *interp, int * Usefull when dealing with command options. * that may come in any order... * - * Does not support "-foo=123" type options. + * Does not support "-foo = 123" type options. * Only supports tcl type options, like "-foo 123" */ @@ -985,19 +985,19 @@ typedef struct jim_getopt { * * Jim_GetOpt_Setup( &goi, interp, argc, argv ); * - * while( goi.argc ){ + * while ( goi.argc ){ * e = Jim_GetOpt_Nvp( &goi, nvp_options, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * Jim_GetOpt_NvpUnknown( &goi, nvp_options, 0 ); * return e; * } * - * switch( n->value ){ + * switch ( n->value ){ * case ALIVE: * printf("Option ALIVE specified\n"); * break; * case FIRST: - * if( goi.argc < 1 ){ + * if ( goi.argc < 1 ){ * .. not enough args error .. * } * Jim_GetOpt_String( &goi, &cp, NULL ); @@ -1008,7 +1008,7 @@ typedef struct jim_getopt { * break; * case POLITICS: * e = Jim_GetOpt_Nvp( &goi, nvp_politics, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * Jim_GetOpt_NvpUnknown( &goi, nvp_politics, 1 ); * return e; * } @@ -1097,26 +1097,26 @@ JIM_STATIC int JIM_API( Jim_GetOpt_Nvp)( Jim_GetOptInfo *goi, const Jim_Nvp *loo * * This function assumes the previous option argv[-1] is the unknown string. * - * If this option had some prefix, then pass "hadprefix=1" else pass "hadprefix=0" + * If this option had some prefix, then pass "hadprefix = 1" else pass "hadprefix = 0" * * Example: * \code * - * while( goi.argc ){ + * while ( goi.argc ){ * // Get the next option * e = Jim_GetOpt_Nvp( &goi, cmd_options, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * // option was not recognized - * // pass 'hadprefix=0' because there is no prefix + * // pass 'hadprefix = 0' because there is no prefix * Jim_GetOpt_NvpUnknown( &goi, cmd_options, 0 ); * return e; * } * - * switch( n->value ){ + * switch ( n->value ){ * case OPT_SEX: - * // handle: --sex male|female|lots|needmore + * // handle: --sex male | female | lots | needmore * e = Jim_GetOpt_Nvp( &goi, &nvp_sex, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * Jim_GetOpt_NvpUnknown( &ogi, nvp_sex, 1 ); * return e; * } @@ -1322,10 +1322,3 @@ static __inline__ void Jim_InitEmbedded(void) { #endif #endif /* __JIM__H */ - -/* - * Local Variables: *** - * c-basic-offset: 4 *** - * tab-width: 4 *** - * End: *** - */