Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

seeing some consts and fixing an indent

  • Loading branch information...
commit a7418362a45fb4d928fb69e4230c30da46b22a57 1 parent a53d37a
@petdance petdance authored
Showing with 8 additions and 9 deletions.
  1. +4 −5 src/alarm.c
  2. +4 −4 src/dynext.c
View
9 src/alarm.c
@@ -91,11 +91,10 @@ posix_alarm_set(FLOATVAL wait)
/* TODO: Implement on Windows */
#else
const int MIL = 1000000;
- struct itimerval itmr;
- int sec, usec;
+ const int sec = (int) wait;
+ const int usec = (int) ((wait - sec) * MIL);
- sec = (int) wait;
- usec = (int) ((wait - sec) * MIL);
+ struct itimerval itmr;
itmr.it_value.tv_sec = sec;
itmr.it_value.tv_usec = usec;
@@ -218,7 +217,7 @@ Parrot_alarm_set(FLOATVAL when)
#ifdef _WIN32
/* TODO: Implement on Windows */
#else
- FLOATVAL now = Parrot_floatval_time();
+ const FLOATVAL now = Parrot_floatval_time();
/* Better late than early */
when += 0.0001;
View
8 src/dynext.c
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2011, Parrot Foundation.
+Copyright (C) 2001-2012, Parrot Foundation.
=head1 NAME
@@ -446,8 +446,8 @@ Parrot_dyn_dlsym_str(PARROT_INTERP,
return NULL;
else {
- char *const symbol_cs = Parrot_str_to_cstring(interp, symbol);
- void *ptr = Parrot_dlsym(handle, symbol_cs);
+ char * const symbol_cs = Parrot_str_to_cstring(interp, symbol);
+ void * const ptr = Parrot_dlsym(handle, symbol_cs);
Parrot_str_free_cstring(symbol_cs);
return ptr;
}
@@ -585,7 +585,7 @@ Parrot_dyn_clone_lib_into(ARGMOD(Interp *d), ARGMOD(Interp *s), ARGIN(PMC *lib_p
* Anyways, if we hope to share bytecode at runtime, we need to have
* them have identical opcodes anyways.
*/
- PMC * const new_lib_pmc = Parrot_pmc_new(d, enum_class_ParrotLibrary);
+ PMC * const new_lib_pmc = Parrot_pmc_new(d, enum_class_ParrotLibrary);
PMC_data(new_lib_pmc) = handle;
Parrot_pmc_setprop(d, new_lib_pmc, CONST_STRING(s, "_filename"), Parrot_pmc_box_string(d, wo_ext));
Please sign in to comment.
Something went wrong with that request. Please try again.