Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : libs/embryo

Dir     : e17/libs/embryo/src/lib


Modified Files:
        embryo_amx.c embryo_args.c embryo_float.c embryo_main.c 
        embryo_private.h embryo_rand.c embryo_str.c embryo_time.c 


Log Message:
remove trailing spaces and add indent doc for vi

===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_amx.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- embryo_amx.c        27 Jun 2007 10:57:54 -0000      1.32
+++ embryo_amx.c        11 Apr 2008 19:06:18 -0000      1.33
@@ -19,6 +19,11 @@
  *      misrepresented as being the original software.
  *  3.  This notice may not be removed or altered from any source distribution.
  */
+
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include "embryo_private.h"
 
 #define JUMPABS(base, ip)     ((Embryo_Cell *)(code + (*ip)))
@@ -37,7 +42,7 @@
 _embryo_byte_swap_16(unsigned short *v)
 {
    unsigned char *s, t;
-   
+
    s = (unsigned char *)v;
    t = s[0]; s[0] = s[1]; s[1] = t;
 }
@@ -46,7 +51,7 @@
 _embryo_byte_swap_32(unsigned int *v)
 {
    unsigned char *s, t;
-   
+
    s = (unsigned char *)v;
    t = s[0]; s[0] = s[3]; s[3] = t;
    t = s[1]; s[1] = s[2]; s[2] = t;
@@ -62,7 +67,7 @@
 
    hdr = (Embryo_Header *)ep->base;
    func_entry = GETENTRY(hdr, natives, index);
-   if ((func_entry->address <= 0) || 
+   if ((func_entry->address <= 0) ||
        (func_entry->address > ep->native_calls_size))
      {
        ep->error = EMBRYO_ERROR_CALLBACK;
@@ -84,11 +89,11 @@
 {
    Embryo_Header    *hdr;
    Embryo_Func_Stub *func;
-   
+
    hdr = (Embryo_Header *)ep->code;
    if (index >= (Embryo_Cell)NUMENTRIES(hdr, publics, natives))
      return EMBRYO_ERROR_INDEX;
-   
+
    func = GETENTRY(hdr, publics, index);
    strcpy(funcname, GETENTRYNAME(hdr, func));
    return EMBRYO_ERROR_NONE;
@@ -115,7 +120,7 @@
 _embryo_program_init(Embryo_Program *ep, void *code)
 {
    Embryo_Header    *hdr;
-   
+
    if ((ep->flags & EMBRYO_FLAG_RELOC)) return 1;
    ep->code = (unsigned char *)code;
    hdr = (Embryo_Header *)ep->code;
@@ -136,30 +141,30 @@
    embryo_swap_32((unsigned int *)&hdr->tags);
    embryo_swap_32((unsigned int *)&hdr->nametable);
 #endif
-   
+
    if (hdr->magic != EMBRYO_MAGIC) return 0;
    if ((hdr->file_version < MIN_FILE_VERSION) ||
       (hdr->ep_version > CUR_FILE_VERSION)) return 0;
-   if ((hdr->defsize != sizeof(Embryo_Func_Stub)) && 
+   if ((hdr->defsize != sizeof(Embryo_Func_Stub)) &&
       (hdr->defsize != (2 * sizeof(unsigned int)))) return 0;
    if (hdr->defsize == (2 * sizeof(unsigned int)))
      {
        unsigned short *len;
-       
+
        len = (unsigned short*)((unsigned char*)ep->code + hdr->nametable);
 #ifdef WORDS_BIGENDIAN
        embryo_swap_16((unsigned short *)len);
-#endif 
+#endif
        if (*len > sNAMEMAX) return 0;
      }
    if (hdr->stp <= 0) return 0;
    if ((hdr->flags & EMBRYO_FLAG_COMPACT)) return 0;
-   
+
 #ifdef WORDS_BIGENDIAN
      {
        Embryo_Func_Stub *fs;
        int i, num;
-       
+
        /* also align all addresses in the public function, public variable and 
*/
        /* public tag tables */
        fs = GETENTRY(hdr, publics, 0);
@@ -169,7 +174,7 @@
             embryo_swap_32(&(fs->address));
             fs = (Embryo_Func_Stub *)((unsigned char *)fs + hdr->defsize);
          }
-       
+
        fs = GETENTRY(hdr, pubvars, 0);
        num = NUMENTRIES(hdr, pubvars, tags);
        for (i = 0; i < num; i++)
@@ -177,7 +182,7 @@
             embryo_swap_32(&(fs->address));
             fs = (Embryo_Func_Stub *)((unsigned char *)fs + hdr->defsize);
          }
-       
+
        fs = GETENTRY(hdr, tags, 0);
        num = NUMENTRIES(hdr, tags, nametable);
        for (i = 0; i < num; i++)
@@ -186,13 +191,13 @@
             fs = (Embryo_Func_Stub *)((unsigned char *)fs + hdr->defsize);
          }
      }
-#endif   
+#endif
    ep->flags = EMBRYO_FLAG_RELOC;
 
      {
        Embryo_Cell cip, code_size;
        Embryo_Cell *code;
-       
+
        code_size = hdr->dat - hdr->cod;
        code = (Embryo_Cell *)((unsigned char *)ep->code + (int)hdr->cod);
        for (cip = 0; cip < (code_size / sizeof(Embryo_Cell)); cip++)
@@ -203,7 +208,7 @@
 #ifdef WORDS_BIGENDIAN
             embryo_swap_32(&(code[cip]));
 #endif
-            
+
          }
      }
    /* init native api for handling floating point - default in embryo */
@@ -235,12 +240,12 @@
 {
    Embryo_Program *ep;
    void *code_data;
-   
+
    if (size < (int)sizeof(Embryo_Header)) return NULL;
-   
+
    ep = calloc(1, sizeof(Embryo_Program));
    if (!ep) return NULL;
-   
+
    code_data = malloc(size);
    if (!code_data)
      {
@@ -255,7 +260,7 @@
 }
 
 /**
- * Creates a new Embryo program, with bytecode data that cannot be 
+ * Creates a new Embryo program, with bytecode data that cannot be
  * freed.
  * @param   data Pointer to the bytecode of the program.
  * @param   size Number of bytes of bytecode.
@@ -266,12 +271,12 @@
 embryo_program_const_new(void *data, int size)
 {
    Embryo_Program *ep;
-   
+
    if (size < (int)sizeof(Embryo_Header)) return NULL;
-   
+
    ep = calloc(1, sizeof(Embryo_Program));
    if (!ep) return NULL;
-   
+
    if (_embryo_program_init(ep, data))
      {
        ep->dont_free_code = 1;
@@ -296,7 +301,7 @@
    FILE *f;
    void *program = NULL;
    int program_size = 0;
-   
+
    f = fopen(file, "rb");
    if (!f) return NULL;
    fseek(f, 0, SEEK_END);
@@ -315,7 +320,7 @@
    rewind(f);
 #ifdef WORDS_BIGENDIAN
    embryo_swap_32((unsigned int *)(&hdr.size));
-#endif   
+#endif
    if ((int)hdr.size < program_size) program_size = hdr.size;
    program = malloc(program_size);
    if (!program)
@@ -344,7 +349,7 @@
 embryo_program_free(Embryo_Program *ep)
 {
    int i;
-   
+
    if (ep->base) free(ep->base);
    if ((!ep->dont_free_code) && (ep->code)) free(ep->code);
    if (ep->native_calls) free(ep->native_calls);
@@ -379,7 +384,7 @@
 
    if ((ep == NULL ) || (name == NULL) || (func == NULL)) return;
    if (strlen(name) > sNAMEMAX) return;
-   
+
    hdr = (Embryo_Header *)ep->code;
    if (hdr->defsize < 1) return;
    num = NUMENTRIES(hdr, natives, libraries);
@@ -389,9 +394,9 @@
    if (ep->native_calls_size > ep->native_calls_alloc)
      {
        Embryo_Native *calls;
-       
+
        ep->native_calls_alloc += 16;
-       calls = realloc(ep->native_calls, 
+       calls = realloc(ep->native_calls,
                        ep->native_calls_alloc * sizeof(Embryo_Native));
        if (!calls)
          {
@@ -402,14 +407,14 @@
        ep->native_calls = calls;
      }
    ep->native_calls[ep->native_calls_size - 1] = func;
-   
+
    func_entry = GETENTRY(hdr, natives, 0);
    for (i = 0; i < num; i++)
      {
        if (func_entry->address == 0)
          {
             char *entry_name;
-            
+
             entry_name = GETENTRYNAME(hdr, func_entry);
             if ((entry_name) && (!strcmp(entry_name, name)))
               {
@@ -420,7 +425,7 @@
                  /* return; */
               }
          }
-       func_entry = 
+       func_entry =
          (Embryo_Func_Stub *)((unsigned char *)func_entry + hdr->defsize);
      }
 }
@@ -453,12 +458,12 @@
 embryo_program_vm_reset(Embryo_Program *ep)
 {
    Embryo_Header *hdr;
-   
+
    if ((!ep) || (!ep->base)) return;
    hdr = (Embryo_Header *)ep->code;
    memcpy(ep->base, hdr, hdr->size);
    *(Embryo_Cell *)(ep->base + (int)hdr->stp - sizeof(Embryo_Cell)) = 0;
-   
+
    ep->hlw = hdr->hea - hdr->dat; /* stack and heap relative to data segment */
    ep->stp = hdr->stp - hdr->dat - sizeof(Embryo_Cell);
    ep->hea = ep->hlw;
@@ -549,7 +554,7 @@
 {
 #ifdef WORDS_BIGENDIAN
    _embryo_byte_swap_32(v);
-#endif   
+#endif
 }
 
 /**
@@ -642,14 +647,14 @@
 embryo_program_variable_count_get(Embryo_Program *ep)
 {
    Embryo_Header *hdr;
-   
+
    if (!ep) return 0;
    if (!ep->base) return 0;
    hdr = (Embryo_Header *)ep->base;
    return NUMENTRIES(hdr, pubvars, tags);
 }
 
-/** 
+/**
  * Retrieves the location of the public variable in the given program
  * with the given identifier.
  * @param   ep  The given program.
@@ -664,7 +669,7 @@
    Embryo_Header *hdr;
    Embryo_Cell    paddr;
    char           pname[sNAMEMAX + 1];
-   
+
    if (!ep) return EMBRYO_CELL_NONE;
    if (!ep->base) return EMBRYO_CELL_NONE;
    hdr = (Embryo_Header *)ep->base;
@@ -708,7 +713,7 @@
 /**
  * @defgroup Embryo_Program_Data_Group Program Data Functions
  *
- * Functions that set and retrieve data associated with the given 
+ * Functions that set and retrieve data associated with the given
  * program.
  */
 
@@ -799,7 +804,7 @@
 {
    int            len;
    Embryo_Header *hdr;
-   
+
    if ((!ep) || (!ep->base)) return 0;
    hdr = (Embryo_Header *)ep->base;
    if ((!str_cell) ||
@@ -822,7 +827,7 @@
 {
    int            i;
    Embryo_Header *hdr;
-   
+
    if (!dst) return;
    if ((!ep) || (!ep->base))
      {
@@ -842,14 +847,14 @@
 #ifdef WORDS_BIGENDIAN
          {
             Embryo_Cell tmp;
-            
+
             tmp = str_cell[i];
             _embryo_byte_swap_32(&tmp);
             dst[i] = tmp;
          }
 #else
        dst[i] = str_cell[i];
-#endif 
+#endif
      }
    dst[i] = 0;
 }
@@ -867,7 +872,7 @@
 {
    int            i;
    Embryo_Header *hdr;
-   
+
    if (!ep) return;
    if (!ep->base) return;
    hdr = (Embryo_Header *)ep->base;
@@ -891,14 +896,14 @@
 #ifdef WORDS_BIGENDIAN
          {
             Embryo_Cell tmp;
-            
+
             tmp = src[i];
             _embryo_byte_swap_32(&tmp);
             str_cell[i] = tmp;
          }
 #else
        str_cell[i] = src[i];
-#endif 
+#endif
      }
    str_cell[i] = 0;
 }
@@ -916,7 +921,7 @@
 {
    Embryo_Header *hdr;
    unsigned char *data;
-   
+
    if ((!ep) || (!ep->base)) return NULL;
    hdr = (Embryo_Header *)ep->base;
    data = ep->base + (int)hdr->dat;
@@ -1012,7 +1017,7 @@
 #endif
 
 /**
- * Runs the given function of the given Embryo program in the current 
+ * Runs the given function of the given Embryo program in the current
  * virtual machine.  The parameter @p fn can be found using
  * @ref embryo_program_function_find.
  *
@@ -1216,7 +1221,7 @@
          &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, 
&&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, 
&&SWITCHTABLE_EMBRYO_OP_NONE,
          &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, 
&&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE
      };
-#endif     
+#endif
    if (!ep) return EMBRYO_PROGRAM_FAIL;
    if (!(ep->flags & EMBRYO_FLAG_RELOC))
      {
@@ -1234,7 +1239,7 @@
        /* FIXME: test C->vm->C->vm recursion more fully */
        /* it seems to work... just fine!!! - strange! */
      }
-   
+
    /* set up the registers */
    hdr = (Embryo_Header *)ep->base;
    codesize = (Embryo_UCell)(hdr->dat - hdr->cod);
@@ -1290,17 +1295,17 @@
    if (fn != EMBRYO_FUNCTION_CONT)
      {
        int i;
-       
+
        for (i = ep->params_size - 1; i >= 0; i--)
          {
             Embryo_Param *pr;
-            
+
             pr = &(ep->params[i]);
             if (pr->string)
               {
                  int len;
                  Embryo_Cell ep_addr, *addr;
-                 
+
                  len = strlen(pr->string);
                  ep_addr = embryo_data_heap_push(ep, len + 1);
                  if (ep_addr == EMBRYO_CELL_NONE)
@@ -1323,7 +1328,7 @@
               {
                  int len;
                  Embryo_Cell ep_addr, *addr;
-                 
+
                  len = pr->cell_array_size;
                  ep_addr = embryo_data_heap_push(ep, len + 1);
                  if (ep_addr == EMBRYO_CELL_NONE)
@@ -1333,7 +1338,7 @@
                    }
                  addr = embryo_data_address_get(ep, ep_addr);
                  if (addr)
-                   memcpy(addr, pr->cell_array, 
+                   memcpy(addr, pr->cell_array,
                           pr->cell_array_size * sizeof(Embryo_Cell));
                  else
                    {
@@ -1532,14 +1537,14 @@
 #ifdef WORDS_BIGENDIAN
        if ((size_t)offs < sizeof(Embryo_Cell))
          pri ^= sizeof(Embryo_Cell) - offs;
-#endif       
+#endif
        BREAK;
        CASE(EMBRYO_OP_ALIGN_ALT);
        GETPARAM(offs);
 #ifdef WORDS_BIGENDIAN
        if ((size_t)offs < sizeof(Embryo_Cell))
          alt ^= sizeof(Embryo_Cell) - offs;
-#endif       
+#endif
        BREAK;
        CASE(EMBRYO_OP_LCTRL);
        GETPARAM(offs);
@@ -1968,8 +1973,8 @@
        GETPARAM(offs);
        CHKMEM(alt);
        CHKMEM(alt + offs);
-       for (i = (int)alt; 
-            (size_t)offs >= sizeof(Embryo_Cell); 
+       for (i = (int)alt;
+            (size_t)offs >= sizeof(Embryo_Cell);
             i += sizeof(Embryo_Cell), offs -= sizeof(Embryo_Cell))
          *(Embryo_Cell *)(data + i) = pri;
        BREAK;
@@ -2040,14 +2045,14 @@
                  Embryo_Header    *hdr;
                  int i, num;
                  Embryo_Func_Stub *func_entry;
-                 
+
                  hdr = (Embryo_Header *)ep->code;
                  num = NUMENTRIES(hdr, natives, libraries);
                  func_entry = GETENTRY(hdr, natives, 0);
                  for (i = 0; i < num; i++)
                    {
                       char *entry_name;
-                      
+
                       entry_name = GETENTRYNAME(hdr, func_entry);
                       if (i == offs)
                         printf("EMBRYO: CALL [%i] %s() non-existant!\n", i, 
entry_name);
@@ -2086,15 +2091,15 @@
        CASE(EMBRYO_OP_SWITCH);
          {
             Embryo_Cell *cptr;
-            
+
             /* +1, to skip the "casetbl" opcode */
             cptr = (Embryo_Cell *)(code + (*cip)) + 1;
             /* number of records in the case table */
             num = (int)(*cptr);
             /* preset to "none-matched" case */
             cip = (Embryo_Cell *)(code + *(cptr + 1));
-            for (cptr += 2; 
-                 (num > 0) && (*cptr != pri); 
+            for (cptr += 2;
+                 (num > 0) && (*cptr != pri);
                  num--, cptr += 2);
             /* case found */
             if (num > 0)
@@ -2128,7 +2133,7 @@
 #ifndef EMBRYO_EXEC_JUMPTABLE
       default:
        ABORT(ep, EMBRYO_ERROR_INVINSTR);
-#endif         
+#endif
        SWITCHEND;
      }
    ep->max_run_cycles = max_run_cycles;
@@ -2155,26 +2160,26 @@
 /**
  * Sets the maximum number of abstract machine cycles any given program run
  * can execute before being put to sleep and returning.
- * 
+ *
  * @param   ep The given program.
  * @param   max The number of machine cycles as a limit.
- * 
+ *
  * This sets the maximum number of abstract machine (virtual machine)
  * instructions that a single run of an embryo function (even if its main)
  * can use before embryo embryo_program_run() reutrns with the value
  * EMBRYO_PROGRAM_TOOLONG. If the function fully executes within this number
- * of cycles, embryo_program_run() will return as normal with either 
+ * of cycles, embryo_program_run() will return as normal with either
  * EMBRYO_PROGRAM_OK, EMBRYO_PROGRAM_FAIL or EMBRYO_PROGRAM_SLEEP. If the
  * run exceeds this instruction count, then EMBRYO_PROGRAM_TOOLONG will be
  * returned indicating the program exceeded its run count. If the app wishes
  * to continue running this anyway - it is free to process its own events or
- * whatever it wants and continue the function by calling 
+ * whatever it wants and continue the function by calling
  * embryo_program_run(program, EMBRYO_FUNCTION_CONT); which will start the
  * run again until the instruction count is reached. This can keep being done
  * to allow the calling program to still be able to control things outside the
  * embryo function being called. If the maximum run cycle count is 0 then the
  * program is allowed to run forever only returning when it is done.
- * 
+ *
  * It is important to note that abstract machine cycles are NOT the same as
  * the host machine cpu cycles. They are not fixed in runtime per cycle, so
  * this is more of a helper tool than a way to HARD-FORCE a script to only
@@ -2188,16 +2193,16 @@
  * on how loaded the system is. Making the max cycle run too low will
  * impact performance requiring the abstract machine to do setup and teardown
  * cycles too often comapred to cycles actually executed.
- * 
+ *
  * Also note it does NOT include nested abstract machines. IF this abstract
  * machine run calls embryo script that calls a native function that in turn
  * calls more embryo script, then the 2nd (and so on) levels are not included
  * in this run count. They can set their own max instruction count values
  * separately.
- * 
+ *
  * The default max cycle run value is 0 in any program until set with this
  * function.
- * 
+ *
  * @ingroup Embryo_Run_Group
  */
 EAPI void
@@ -2212,12 +2217,12 @@
  * Retreives the maximum number of abstract machine cycles a program is allowed
  * to run.
  * @param   ep The given program.
- * @return  The number of cycles a run cycle is allowed to run for this 
+ * @return  The number of cycles a run cycle is allowed to run for this
  *          program.
- * 
+ *
  * This returns the value set by embryo_program_max_cycle_run_set(). See
  * embryo_program_max_cycle_run_set() for more information.
- * 
+ *
  * @ingroup Embryo_Run_Group
  */
 EAPI int
@@ -2245,7 +2250,7 @@
 embryo_parameter_cell_push(Embryo_Program *ep, Embryo_Cell cell)
 {
    Embryo_Param *pr;
-   
+
    ep->params_size++;
    if (ep->params_size > ep->params_alloc)
      {
@@ -2276,7 +2281,7 @@
 {
    Embryo_Param *pr;
    char *str_dup;
-   
+
    if (!str)
      return embryo_parameter_string_push(ep, "");
    str_dup = strdup(str);
@@ -2316,7 +2321,7 @@
 {
    Embryo_Param *pr;
    Embryo_Cell *cell_array;
-   
+
    cell_array = malloc(num * sizeof(Embryo_Cell));
    if ((!cells) || (num <= 0))
      return embryo_parameter_cell_push(ep, 0);
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_args.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- embryo_args.c       11 Apr 2008 05:59:42 -0000      1.6
+++ embryo_args.c       11 Apr 2008 19:06:18 -0000      1.7
@@ -1,6 +1,7 @@
 /*
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
+
 #include "embryo_private.h"
 
 #define STRSET(ep, par, str) { \
@@ -17,10 +18,10 @@
    Embryo_Header *hdr;
    unsigned char *data;
    Embryo_Cell bytes;
-   
+
    hdr = (Embryo_Header *)ep->base;
    data = ep->base + (int)hdr->dat;
-   bytes = *(Embryo_Cell *)(data + (int)ep->frm + 
+   bytes = *(Embryo_Cell *)(data + (int)ep->frm +
                            (2 * sizeof(Embryo_Cell)));
    return bytes / sizeof(Embryo_Cell);
 }
@@ -31,11 +32,11 @@
    Embryo_Header *hdr;
    unsigned char *data;
    Embryo_Cell val;
-   
+
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
    hdr = (Embryo_Header *)ep->base;
    data = ep->base + (int)hdr->dat;
-   val = *(Embryo_Cell *)(data + (int)ep->frm + 
+   val = *(Embryo_Cell *)(data + (int)ep->frm +
                          (((int)params[1] + 3) * sizeof(Embryo_Cell)));
    val += params[2] * sizeof(Embryo_Cell);
    val = *(Embryo_Cell *)(data + (int)val);
@@ -48,11 +49,11 @@
    Embryo_Header *hdr;
    unsigned char *data;
    Embryo_Cell val;
-   
+
    if (params[0] != (3 * sizeof(Embryo_Cell))) return 0;
    hdr = (Embryo_Header *)ep->base;
    data = ep->base + (int)hdr->dat;
-   val = *(Embryo_Cell *)(data + (int)ep->frm + 
+   val = *(Embryo_Cell *)(data + (int)ep->frm +
                          (((int)params[1] + 3) * sizeof(Embryo_Cell)));
    val += params[2] * sizeof(Embryo_Cell);
    if ((val < 0) || ((val >= ep->hea) && (val < ep->stk))) return 0;
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_float.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- embryo_float.c      11 Apr 2008 05:59:42 -0000      1.3
+++ embryo_float.c      11 Apr 2008 19:06:18 -0000      1.4
@@ -35,6 +35,11 @@
  *             E coding style. Added extra parameter checks.
  *             Carsten Haitzler, <[EMAIL PROTECTED]>
  */
+
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include <math.h>
 #include "embryo_private.h"
 
@@ -64,7 +69,7 @@
 {
    /* params[1] = long value to convert to a float */
    float f;
-   
+
    if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    f = (float)params[1];
    return EMBRYO_FLOAT_TO_CELL(f);
@@ -78,7 +83,7 @@
    Embryo_Cell *str;
    float f;
    int len;
-   
+
    if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    str = embryo_data_address_get(ep, params[1]);
    len = embryo_data_string_length_get(ep, str);
@@ -94,7 +99,7 @@
    /* params[1] = float operand 1 */
    /* params[2] = float operand 2 */
    float f;
-   
+
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]) * EMBRYO_CELL_TO_FLOAT(params[2]);
    return EMBRYO_FLOAT_TO_CELL(f);
@@ -106,7 +111,7 @@
    /* params[1] = float dividend (top) */
    /* params[2] = float divisor (bottom) */
    float f;
-   
+
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]) / EMBRYO_CELL_TO_FLOAT(params[2]);
    return EMBRYO_FLOAT_TO_CELL(f);
@@ -118,7 +123,7 @@
    /* params[1] = float operand 1 */
    /* params[2] = float operand 2 */
    float f;
-   
+
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]) + EMBRYO_CELL_TO_FLOAT(params[2]);
    return EMBRYO_FLOAT_TO_CELL(f);
@@ -130,7 +135,7 @@
    /* params[1] = float operand 1 */
    /* params[2] = float operand 2 */
    float f;
-   
+
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]) - EMBRYO_CELL_TO_FLOAT(params[2]);
    return EMBRYO_FLOAT_TO_CELL(f);
@@ -142,7 +147,7 @@
 {
    /* params[1] = float operand */
    float f;
-   
+
    if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]);
    f -= (float)(floor((double)f));
@@ -156,7 +161,7 @@
    /* params[1] = float operand */
    /* params[2] = Type of rounding (cell) */
    float f;
-   
+
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]);
    switch (params[2])
@@ -198,7 +203,7 @@
 {
    /* params[1] = float operand */
    float f;
-   
+
    if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]);
    f = (float)sqrt(f);
@@ -278,7 +283,7 @@
    /* params[1] = float operand 1 (angle) */
    /* params[2] = float operand 2 (radix) */
    float f;
-   
+
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]);
    f = _embryo_fp_degrees_to_radians(f, params[2]);
@@ -291,7 +296,7 @@
 {
    /* params[1] = float operand */
    float f;
-   
+
    if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    f = EMBRYO_CELL_TO_FLOAT(params[1]);
    f = (f >= 0) ? f : -f;
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- embryo_main.c       6 Jan 2006 18:02:51 -0000       1.4
+++ embryo_main.c       11 Apr 2008 19:06:18 -0000      1.5
@@ -1,3 +1,7 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include "embryo_private.h"
 #include <time.h>
 
@@ -11,20 +15,20 @@
  * Functions that start up and shutdown the Embryo library.
  */
 
-/** 
+/**
  * Initialises the Embryo library.
  * @return  The number of times the library has been initialised without being
  *          shut down.
  * @ingroup Embryo_Library_Group
- */   
+ */
 EAPI int
 embryo_init(void)
 {
    _embryo_init_count++;
    if (_embryo_init_count > 1) return _embryo_init_count;
-   
+
    srand(time(NULL));
-   
+
    return _embryo_init_count;
 }
 
@@ -39,6 +43,6 @@
 {
    _embryo_init_count--;
    if (_embryo_init_count > 0) return _embryo_init_count;
-   
+
    return _embryo_init_count;
 }
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_private.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- embryo_private.h    11 Apr 2008 05:59:42 -0000      1.18
+++ embryo_private.h    11 Apr 2008 19:06:18 -0000      1.19
@@ -269,19 +269,19 @@
    Embryo_Native *native_calls;
    int            native_calls_size;
    int            native_calls_alloc;
-   
+
    unsigned char *code;
    unsigned char  dont_free_code : 1;
    Embryo_Cell    retval;
-   
+
    Embryo_Param  *params;
    int            params_size;
    int            params_alloc;
-   
+
    int            run_count;
-   
+
    int            max_run_cycles;
-   
+
    void          *data;
 };
 
@@ -317,5 +317,5 @@
 void _embryo_rand_init(Embryo_Program *ep);
 void _embryo_str_init(Embryo_Program *ep);
 void _embryo_time_init(Embryo_Program *ep);
-    
+
 #endif
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_rand.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- embryo_rand.c       11 Apr 2008 05:59:42 -0000      1.2
+++ embryo_rand.c       11 Apr 2008 19:06:18 -0000      1.3
@@ -1,3 +1,7 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include "embryo_private.h"
 
 /* exported random number api */
@@ -13,7 +17,7 @@
 {
    double r;
    float f;
-   
+
    r = (double)(rand() & 0xffff) / 65535.0;
    f = (float)r;
    return EMBRYO_FLOAT_TO_CELL(f);
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_str.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- embryo_str.c        8 Jan 2005 08:57:00 -0000       1.7
+++ embryo_str.c        11 Apr 2008 19:06:18 -0000      1.8
@@ -1,3 +1,7 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include "embryo_private.h"
 #include <fnmatch.h>
 
@@ -22,7 +26,7 @@
 _embryo_str_atoi(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1;
-   
+
    /* params[1] = str */
    if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    STRGET(ep, s1, params[1]);
@@ -34,7 +38,7 @@
 _embryo_str_fnmatch(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2;
-   
+
    /* params[1] = glob */
    /* params[2] = str */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
@@ -48,7 +52,7 @@
 _embryo_str_strcmp(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2;
-   
+
    /* params[1] = str1 */
    /* params[2] = str2 */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return -1;
@@ -62,7 +66,7 @@
 _embryo_str_strncmp(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2;
-   
+
    /* params[1] = str1 */
    /* params[2] = str2 */
    /* params[3] = n */
@@ -78,7 +82,7 @@
 _embryo_str_strcpy(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1;
-   
+
    /* params[1] = dst */
    /* params[2] = str */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
@@ -93,7 +97,7 @@
 {
    char *s1;
    int l;
-   
+
    /* params[1] = dst */
    /* params[2] = str */
    /* params[3] = n */
@@ -111,7 +115,7 @@
 _embryo_str_strlen(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1;
-   
+
    /* params[1] = str */
    if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    STRGET(ep, s1, params[1]);
@@ -123,7 +127,7 @@
 _embryo_str_strcat(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2, *s3;
-   
+
    /* params[1] = dsr */
    /* params[2] = str */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
@@ -143,7 +147,7 @@
 {
    char *s1, *s2, *s3;
    int l1, l2;
-   
+
    /* params[1] = dst */
    /* params[2] = str */
    /* params[3] = n */
@@ -167,7 +171,7 @@
 _embryo_str_strprep(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2, *s3;
-   
+
    /* params[1] = dst */
    /* params[2] = str */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
@@ -187,7 +191,7 @@
 {
    char *s1, *s2, *s3;
    int l1, l2;
-   
+
    /* params[1] = dst */
    /* params[2] = str */
    /* params[3] = n */
@@ -212,7 +216,7 @@
 {
    char *s1, *s2;
    int l1;
-   
+
    /* params[1] = dst */
    /* params[2] = str */
    /* params[3] = n */
@@ -227,7 +231,7 @@
    if (params[4] >= l1) params[4] = l1;
    if (params[4] == params[3])
      {
-       STRSET(ep, params[1], "");   
+       STRSET(ep, params[1], "");
        return 0;
      }
    s2 = alloca(params[4] - params[3] + 1);
@@ -245,7 +249,7 @@
    int inesc = 0;
    int insub = 0;
    int p, pnum;
-   
+
    /* params[1] = buf */
    /* params[2] = bufsize */
    /* params[3] = format_string */
@@ -273,7 +277,7 @@
        else
          {
             Embryo_Cell *cptr;
-            
+
             if (inesc)
               {
                  switch (s1[i])
@@ -315,7 +319,7 @@
                            char fmt[10] = "";
                            char tmp[256] = "";
                            int l;
-                           
+
                            if      (s1[i] == 'i') strcpy(fmt, "%i");
                            else if (s1[i] == 'd') strcpy(fmt, "%d");
                            else if (s1[i] == 'x') strcpy(fmt, "%x");
@@ -338,7 +342,7 @@
                         {
                            char tmp[256] = "";
                            int l;
-                           
+
                            cptr = embryo_data_address_get(ep, params[4 + p]);
                            if (cptr) snprintf(tmp, sizeof(tmp), "%f", 
(double)EMBRYO_CELL_TO_FLOAT(*cptr));
                            l = strlen(tmp);
@@ -357,7 +361,7 @@
                         {
                            char *tmp;
                            int l;
-                           
+
                            STRGET(ep, tmp, params[4 + p]);
                            l = strlen(tmp);
                            if ((o + l) > (params[2] - 1))
@@ -381,7 +385,7 @@
          }
      }
    s2[o] = 0;
-   
+
    STRSET(ep, params[1], s2);
    return o;
 }
@@ -390,7 +394,7 @@
 _embryo_str_strstr(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2, *p;
-   
+
    /* params[1] = str */
    /* params[2] = ndl */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
@@ -406,7 +410,7 @@
 _embryo_str_strchr(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2, *p;
-   
+
    /* params[1] = str */
    /* params[2] = ch */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
@@ -421,7 +425,7 @@
 _embryo_str_strrchr(Embryo_Program *ep, Embryo_Cell *params)
 {
    char *s1, *s2, *p;
-   
+
    /* params[1] = str */
    /* params[2] = ch */
    if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_time.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- embryo_time.c       11 Apr 2008 05:59:42 -0000      1.4
+++ embryo_time.c       11 Apr 2008 19:06:18 -0000      1.5
@@ -1,6 +1,7 @@
 /*
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
+
 #include "embryo_private.h"
 #include <sys/time.h>
 #include <time.h>
@@ -17,7 +18,7 @@
    struct timeval      timev;
    double t;
    float  f;
-   
+
    gettimeofday(&timev, NULL);
    t = (double)(timev.tv_sec - ((timev.tv_sec / (60 * 60 * 24)) * (60 * 60 * 
24)))
      + (((double)timev.tv_usec) / 1000000);
@@ -31,7 +32,7 @@
    struct timeval      timev;
    struct tm          *tm;
    time_t              tt;
-   
+
    if (params[0] != (8 * sizeof(Embryo_Cell))) return 0;
    gettimeofday(&timev, NULL);
    tt = (time_t)(timev.tv_sec);
@@ -41,7 +42,7 @@
        Embryo_Cell *cptr;
        double t;
        float  f;
-       
+
        cptr = embryo_data_address_get(ep, params[1]);
        if (cptr) *cptr = tm->tm_year + 1900;
        cptr = embryo_data_address_get(ep, params[2]);
@@ -60,7 +61,7 @@
        t = (double)tm->tm_sec + (((double)timev.tv_usec) / 1000000);
        f = (float)t;
        if (cptr) *cptr = EMBRYO_FLOAT_TO_CELL(f);
-       
+
      }
    return 0;
 }



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to