[svn:parrot] r47835 - trunk/compilers/opsc/src/Ops/Trans
petdance at svn.parrot.org
petdance at svn.parrot.org
Fri Jun 25 15:23:35 UTC 2010
Author: petdance
Date: Fri Jun 25 15:23:35 2010
New Revision: 47835
URL: https://trac.parrot.org/parrot/changeset/47835
Log:
normalize C headers to match the rest of the codebase
Modified:
trunk/compilers/opsc/src/Ops/Trans/C.pm
Modified: trunk/compilers/opsc/src/Ops/Trans/C.pm
==============================================================================
--- trunk/compilers/opsc/src/Ops/Trans/C.pm Fri Jun 25 15:21:23 2010 (r47834)
+++ trunk/compilers/opsc/src/Ops/Trans/C.pm Fri Jun 25 15:23:35 2010 (r47835)
@@ -299,7 +299,10 @@
* returns >= 0 (found idx into info_table), -1 if not
*/
-static size_t hash_str(const char *str) {
+PARROT_PURE_FUNCTION
+static
+size_t hash_str(ARGIN(const char *str))
+{
size_t key = 0;
const char *s = str;
@@ -311,7 +314,8 @@
return key;
}
-static void store_op(PARROT_INTERP, op_info_t *info, int full) {
+static void store_op(PARROT_INTERP, op_info_t *info, int full)
+{
HOP * const p = mem_gc_allocate_zeroed_typed(interp, HOP);
const size_t hidx =
hash_str(full ? info->full_name : info->name) % OP_HASH_SIZE;
@@ -320,7 +324,9 @@
p->next = hop[hidx];
hop[hidx] = p;
}
-static int get_op(PARROT_INTERP, const char * name, int full) {
+
+static int get_op(PARROT_INTERP, const char * name, int full)
+{
const HOP * p;
const size_t hidx = hash_str(name) % OP_HASH_SIZE;
if (!hop) {
@@ -333,7 +339,9 @@
}
return -1;
}
-static void hop_init(PARROT_INTERP) {
+
+static void hop_init(PARROT_INTERP)
+{
size_t i;
op_info_t * const info = [[BS]]op_lib.op_info_table;
/* store full names */
@@ -344,6 +352,7 @@
if (get_op(interp, info[i].name, 0) == -1)
store_op(interp, info + i, 0);
}
+
static void hop_deinit(PARROT_INTERP)
{
if (hop) {
More information about the parrot-commits
mailing list