aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-01-25 21:44:48 +0100
committerPatrik Nyblom <[email protected]>2013-01-25 21:44:48 +0100
commitdebbee7ddf7b356f10f1dc12c874ed6e80c02c20 (patch)
tree42464367c52bb177cb037faa2faec70673a0fe34 /erts/emulator/beam
parent725618258bdd33e25e5a156f6774832054a6af9a (diff)
parent90b44f551fd3d988b34a9fb7d32598b789a0c546 (diff)
downloadotp-debbee7ddf7b356f10f1dc12c874ed6e80c02c20.tar.gz
otp-debbee7ddf7b356f10f1dc12c874ed6e80c02c20.tar.bz2
otp-debbee7ddf7b356f10f1dc12c874ed6e80c02c20.zip
Merge branch 'pan/fix-compiler-warnings-clang-and-new-gcc'
* pan/fix-compiler-warnings-clang-and-new-gcc: Fix compiler warnings from GCC 4.7.1 on ARCH Linux Fix clang compiler warnings on FreeBSD in erts
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/beam_bp.c2
-rw-r--r--erts/emulator/beam/beam_load.c2
-rw-r--r--erts/emulator/beam/bif.c3
-rw-r--r--erts/emulator/beam/dist.c6
-rwxr-xr-xerts/emulator/beam/erl_bif_info.c4
-rw-r--r--erts/emulator/beam/erl_bif_re.c3
-rw-r--r--erts/emulator/beam/erl_instrument.c4
-rw-r--r--erts/emulator/beam/erl_port_task.c16
-rw-r--r--erts/emulator/beam/erl_process.c21
-rw-r--r--erts/emulator/beam/export.c7
-rw-r--r--erts/emulator/beam/external.c4
-rw-r--r--erts/emulator/beam/packet_parser.c6
12 files changed, 49 insertions, 29 deletions
diff --git a/erts/emulator/beam/beam_bp.c b/erts/emulator/beam/beam_bp.c
index c1e11f6448..9b17de34ec 100644
--- a/erts/emulator/beam/beam_bp.c
+++ b/erts/emulator/beam/beam_bp.c
@@ -969,7 +969,7 @@ erts_trace_time_call(Process* c_p, BeamInstr* I, BpDataTime* bdt)
if (pbt == 0) {
/* First call of process to instrumented function */
pbt = Alloc(sizeof(process_breakpoint_time_t));
- (void *) ERTS_PROC_SET_CALL_TIME(c_p, ERTS_PROC_LOCK_MAIN, pbt);
+ (void) ERTS_PROC_SET_CALL_TIME(c_p, ERTS_PROC_LOCK_MAIN, pbt);
} else {
ASSERT(pbt->pc);
/* add time to previous code */
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 106783b209..f57fa2bfbb 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -5904,7 +5904,7 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info)
Eterm* tp;
Eterm func;
Eterm arity_term;
- Uint arity;
+ Sint arity;
Uint native_address;
Eterm op;
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index a4d7c4fa20..16df37a0fb 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -359,8 +359,7 @@ remote_demonitor(Process *c_p, DistEntry *dep, Eterm ref, Eterm to)
break;
default:
ASSERT(! "Invalid dsig prepare result");
- res = ERTS_DEMONITOR_INTERNAL_ERROR;
- break;
+ return ERTS_DEMONITOR_INTERNAL_ERROR;
}
#ifndef ERTS_SMP
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index dd9de0946d..59fe7ea418 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -2550,9 +2550,9 @@ BIF_RETTYPE setnode_2(BIF_ALIST_2)
/* By setting dist_entry==erts_this_dist_entry and DISTRIBUTION on
net_kernel do_net_exist will be called when net_kernel
is terminated !! */
- (void *) ERTS_PROC_SET_DIST_ENTRY(net_kernel,
- ERTS_PROC_LOCK_MAIN,
- erts_this_dist_entry);
+ (void) ERTS_PROC_SET_DIST_ENTRY(net_kernel,
+ ERTS_PROC_LOCK_MAIN,
+ erts_this_dist_entry);
erts_refc_inc(&erts_this_dist_entry->refc, 2);
net_kernel->flags |= F_DISTRIBUTION;
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index c7760e99fc..a601e4fb39 100755
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -3288,7 +3288,7 @@ BIF_RETTYPE erts_debug_get_internal_state_1(BIF_ALIST_1)
else if (ERTS_IS_ATOM_STR("next_pid", BIF_ARG_1)
|| ERTS_IS_ATOM_STR("next_port", BIF_ARG_1)) {
/* Used by node_container_SUITE (emulator) */
- Eterm res;
+ Sint res;
if (ERTS_IS_ATOM_STR("next_pid", BIF_ARG_1))
res = erts_ptab_test_next_id(&erts_proc, 0, 0);
else
@@ -3646,7 +3646,7 @@ BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2)
Uint next;
if (term_to_Uint(BIF_ARG_2, &next) != 0) {
- Eterm res;
+ Sint res;
if (ERTS_IS_ATOM_STR("next_pid", BIF_ARG_1))
res = erts_ptab_test_next_id(&erts_proc, 1, next);
diff --git a/erts/emulator/beam/erl_bif_re.c b/erts/emulator/beam/erl_bif_re.c
index 09d44ba056..3d34c2a77f 100644
--- a/erts/emulator/beam/erl_bif_re.c
+++ b/erts/emulator/beam/erl_bif_re.c
@@ -184,6 +184,7 @@ static Eterm make_signed_integer(int x, Process *p)
#define CAPSPEC_VALUES 0
#define CAPSPEC_TYPE 1
#define CAPSPEC_SIZE 2
+#define CAPSPEC_INIT {0,0}
static int /* 0 == ok, < 0 == error */
parse_options(Eterm listp, /* in */
@@ -864,7 +865,7 @@ re_run(Process *p, Eterm arg1, Eterm arg2, Eterm arg3)
size_t code_size;
Uint loop_limit_tmp;
unsigned long loop_count;
- Eterm capture[CAPSPEC_SIZE];
+ Eterm capture[CAPSPEC_SIZE] = CAPSPEC_INIT;
int is_list_cap;
if (parse_options(arg3,&comp_options,&options,&pflags,&startoffset,capture)
diff --git a/erts/emulator/beam/erl_instrument.c b/erts/emulator/beam/erl_instrument.c
index 963c8b3c58..7f4349556c 100644
--- a/erts/emulator/beam/erl_instrument.c
+++ b/erts/emulator/beam/erl_instrument.c
@@ -775,8 +775,8 @@ Eterm erts_instr_get_memory_map(Process *proc)
ASSERT(hp + 3 == end_hp);
if (mem_anchor) {
- for (bp = mem_anchor; bp->next; bp = bp->next);
-
+ for (bp = mem_anchor; bp->next; bp = bp->next)
+ ;
ASSERT(org_mem_anchor);
org_mem_anchor->prev = bp;
bp->next = org_mem_anchor;
diff --git a/erts/emulator/beam/erl_port_task.c b/erts/emulator/beam/erl_port_task.c
index f160ce2d78..dbc4a06c2d 100644
--- a/erts/emulator/beam/erl_port_task.c
+++ b/erts/emulator/beam/erl_port_task.c
@@ -282,11 +282,16 @@ busy_wait_move_to_busy_queue(Port *pp, ErtsPortTask *ptp)
}
else {
int i;
+#ifdef DEBUG
erts_aint32_t flags;
-
+#endif
pp->sched.taskq.local.busy.first = ptp;
- flags = erts_smp_atomic32_read_bor_nob(&pp->sched.flags,
- ERTS_PTS_FLG_HAVE_BUSY_TASKS);
+
+#ifdef DEBUG
+ flags =
+#endif
+ erts_smp_atomic32_read_bor_nob(&pp->sched.flags,
+ ERTS_PTS_FLG_HAVE_BUSY_TASKS);
ASSERT(!(flags & ERTS_PTS_FLG_HAVE_BUSY_TASKS));
ASSERT(!tabp);
@@ -1220,15 +1225,14 @@ erts_port_task_abort(ErtsPortTaskHandle *pthp)
void
erts_port_task_abort_nosuspend_tasks(Port *pp)
{
- erts_aint32_t flags;
ErtsPortTaskHandleList *abort_list;
#ifdef ERTS_SMP
ErtsThrPrgrDelayHandle dhndl = ERTS_THR_PRGR_DHANDLE_INVALID;
#endif
erts_port_task_sched_lock(&pp->sched);
- flags = erts_smp_atomic32_read_band_nob(&pp->sched.flags,
- ~ERTS_PTS_FLG_HAVE_NS_TASKS);
+ erts_smp_atomic32_read_band_nob(&pp->sched.flags,
+ ~ERTS_PTS_FLG_HAVE_NS_TASKS);
abort_list = pp->sched.taskq.local.busy.nosuspend;
pp->sched.taskq.local.busy.nosuspend = NULL;
erts_port_task_sched_unlock(&pp->sched);
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 2bcfdad904..96af19fb83 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -4270,6 +4270,7 @@ erts_early_init_scheduling(int no_schedulers)
int
erts_sched_set_wakeup_other_thresold(char *str)
{
+#ifdef ERTS_SMP
ErtsSchedWakeupOtherThreshold threshold;
if (sys_strcmp(str, "very_high") == 0)
threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_HIGH;
@@ -4283,16 +4284,23 @@ erts_sched_set_wakeup_other_thresold(char *str)
threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_LOW;
else
return EINVAL;
-#ifdef ERTS_SMP
wakeup_other.threshold = threshold;
set_wakeup_other_data();
-#endif
return 0;
+#else
+ if (sys_strcmp(str, "very_high") == 0 || sys_strcmp(str, "high") == 0 ||
+ sys_strcmp(str, "medium") == 0 || sys_strcmp(str, "low") == 0 ||
+ sys_strcmp(str, "very_low") == 0) {
+ return 0;
+ }
+ return EINVAL;
+#endif
}
int
erts_sched_set_wakeup_other_type(char *str)
{
+#ifdef ERTS_SMP
ErtsSchedWakeupOtherType type;
if (sys_strcmp(str, "default") == 0)
type = ERTS_SCHED_WAKEUP_OTHER_TYPE_DEFAULT;
@@ -4300,10 +4308,15 @@ erts_sched_set_wakeup_other_type(char *str)
type = ERTS_SCHED_WAKEUP_OTHER_TYPE_LEGACY;
else
return EINVAL;
-#ifdef ERTS_SMP
wakeup_other.type = type;
-#endif
return 0;
+#else
+ if (sys_strcmp(str, "proposal") == 0 || sys_strcmp(str, "default") == 0 ||
+ sys_strcmp(str, "legacy") == 0) {
+ return 0;
+ }
+ return EINVAL;
+#endif
}
int
diff --git a/erts/emulator/beam/export.c b/erts/emulator/beam/export.c
index af1fd35831..b0f08d8245 100644
--- a/erts/emulator/beam/export.c
+++ b/erts/emulator/beam/export.c
@@ -383,7 +383,9 @@ void export_start_staging(void)
IndexTable* dst = &export_tables[dst_ix];
IndexTable* src = &export_tables[src_ix];
struct export_entry* src_entry;
+#ifdef DEBUG
struct export_entry* dst_entry;
+#endif
int i;
ASSERT(dst_ix != src_ix);
@@ -396,7 +398,10 @@ void export_start_staging(void)
for (i = 0; i < src->entries; i++) {
src_entry = (struct export_entry*) erts_index_lookup(src, i);
src_entry->ep->addressv[dst_ix] = src_entry->ep->addressv[src_ix];
- dst_entry = (struct export_entry*) index_put_entry(dst, src_entry);
+#ifdef DEBUG
+ dst_entry = (struct export_entry*)
+#endif
+ index_put_entry(dst, src_entry);
ASSERT(entry_to_blob(src_entry) == entry_to_blob(dst_entry));
}
export_staging_unlock();
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index 83fdb958f8..546e5d6ce0 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -948,7 +948,7 @@ BIF_RETTYPE erts_debug_dist_ext_to_term_2(BIF_ALIST_2)
Eterm res;
Eterm *hp;
Eterm *hendp;
- Uint hsz;
+ Sint hsz;
ErtsDistExternal ede;
Eterm *tp;
Eterm real_bin;
@@ -994,7 +994,7 @@ BIF_RETTYPE erts_debug_dist_ext_to_term_2(BIF_ALIST_2)
if (hsz < 0)
goto badarg;
- hp = HAlloc(BIF_P, hsz);
+ hp = HAlloc(BIF_P, (Uint) hsz);
hendp = hp + hsz;
res = erts_decode_dist_ext(&hp, &MSO(BIF_P), &ede);
diff --git a/erts/emulator/beam/packet_parser.c b/erts/emulator/beam/packet_parser.c
index f1cfa8df39..1e301e3593 100644
--- a/erts/emulator/beam/packet_parser.c
+++ b/erts/emulator/beam/packet_parser.c
@@ -460,11 +460,9 @@ int packet_get_length(enum PacketParseType htype,
hp = (struct tpkt_head*) ptr;
if (hp->vrsn == TPKT_VRSN) {
plen = get_int16(hp->packet_length) - hlen;
- if (plen < 0)
- goto error;
- }
- else
+ } else {
goto error;
+ }
goto remain;
}