Project

General

Profile

Bug #6066 ยป return.not_reached.convert.patch

update /* not reached */ to UNREACHABLE - drbrain (Eric Hodel), 02/26/2012 02:08 PM

View differences:

variable.c (working copy)
690 690
	(*trace->func)(trace->data, data->val);
691 691
	trace = trace->next;
692 692
    }
693
    return Qnil;		/* not reached */
693

  
694
    UNREACHABLE;
694 695
}
695 696

  
696 697
static VALUE
......
1351 1352
	break;
1352 1353
    }
1353 1354
    rb_name_error(id, "instance variable %s not defined", rb_id2name(id));
1354
    return Qnil;		/* not reached */
1355

  
1356
    UNREACHABLE;
1355 1357
}
1356 1358

  
1357 1359
NORETURN(static void uninitialized_constant(VALUE, ID));
......
1415 1417
{
1416 1418
    rb_frame_pop(); /* pop frame for "const_missing" */
1417 1419
    uninitialized_constant(klass, rb_to_id(name));
1418
    return Qnil;		/* not reached */
1420

  
1421
    UNREACHABLE;
1419 1422
}
1420 1423

  
1421 1424
static void
......
2390 2393
    }
2391 2394
    rb_name_error(id, "class variable %s not defined for %s",
2392 2395
		  rb_id2name(id), rb_class2name(mod));
2393
    return Qnil;		/* not reached */
2396

  
2397
    UNREACHABLE;
2394 2398
}
2395 2399

  
2396 2400
VALUE
enum.c (working copy)
709 709

  
710 710
    memo->u1.value = i;
711 711
    rb_iter_break();
712
    return Qnil;		/* not reached */
712

  
713
    UNREACHABLE;
713 714
}
714 715

  
715 716
static VALUE
string.c (working copy)
3175 3175
	idx = NUM2LONG(indx);
3176 3176
	goto num_index;
3177 3177
    }
3178
    return Qnil;		/* not reached */
3178

  
3179
    UNREACHABLE;
3179 3180
}
3180 3181

  
3181 3182

  
......
4088 4089
	idx = NUM2LONG(indx);
4089 4090
	goto num_index;
4090 4091
    }
4091
    return Qnil;		/* not reached */
4092

  
4093
    UNREACHABLE;
4092 4094
}
4093 4095

  
4094 4096
/*
......
7734 7736
      case T_SYMBOL:
7735 7737
	return SYM2ID(name);
7736 7738
    }
7737
    return Qnil; /* not reached */
7739

  
7740
    UNREACHABLE;
7738 7741
}
7739 7742

  
7740 7743
/*
io.c (working copy)
4395 4395
	return MODE_BTMODE("r+", "rb+", "rt+");
4396 4396
    }
4397 4397
    rb_raise(rb_eArgError, "invalid access fmode 0x%x", fmode);
4398
    return NULL;		/* not reached */
4398

  
4399
    UNREACHABLE;
4399 4400
}
4400 4401

  
4401 4402
static int
......
4561 4562
	return MODE_BINARY("r+", "rb+");
4562 4563
    }
4563 4564
    rb_raise(rb_eArgError, "invalid access oflags 0x%x", oflags);
4564
    return NULL;		/* not reached */
4565

  
4566
    UNREACHABLE;
4565 4567
}
4566 4568

  
4567 4569
/*
pack.c (working copy)
247 247
	return rb_big2ulong_pack(x);
248 248
    }
249 249
    rb_raise(rb_eTypeError, "can't convert %s to `integer'", rb_obj_classname(x));
250
    return 0;			/* not reached */
250

  
251
    UNREACHABLE;
251 252
}
252 253

  
253 254
#define MAX_INTEGER_PACK_SIZE 8
vm_eval.c (working copy)
497 497
{
498 498
    rb_thread_t *th = GET_THREAD();
499 499
    raise_method_missing(th, argc, argv, obj, th->method_missing_reason);
500
    return Qnil;		/* not reached */
500
    UNREACHABLE;
501 501
}
502 502

  
503 503
#define NOEX_MISSING   0x80
......
1462 1462

  
1463 1463
    rb_scan_args(argc, argv, "11", &tag, &value);
1464 1464
    rb_throw_obj(tag, value);
1465
    return Qnil;		/* not reached */
1465
    UNREACHABLE;
1466 1466
}
1467 1467

  
1468 1468
void
dir.c (working copy)
590 590
    else {
591 591
	rb_sys_fail(0);
592 592
    }
593
    return Qnil;		/* not reached */
593

  
594
    UNREACHABLE;
594 595
}
595 596

  
596 597
/*
win32/win32.c (working copy)
1074 1074
	GetExitCodeProcess(child->hProcess, &exitcode);
1075 1075
	CloseChildHandle(child);
1076 1076
	_exit(exitcode);
1077
      default:
1078
	return -1;	/* not reached */
1077
      default
1078
	UNREACHABLE;
1079 1079
    }
1080 1080
}
1081 1081

  
struct.c (working copy)
113 113
	}
114 114
    }
115 115
    rb_name_error(id, "%s is not struct member", rb_id2name(id));
116
    return Qnil;		/* not reached */
116

  
117
    UNREACHABLE;
117 118
}
118 119

  
119 120
static VALUE
......
175 176
    }
176 177
    rb_name_error(rb_frame_this_func(), "`%s' is not a struct member",
177 178
		  rb_id2name(rb_frame_this_func()));
178
    return Qnil;		/* not reached */
179

  
180
    UNREACHABLE;
179 181
}
180 182

  
181 183
static VALUE
......
617 619
	}
618 620
    }
619 621
    rb_name_error(id, "no member '%s' in struct", rb_id2name(id));
620
    return Qnil;		/* not reached */
622

  
623
    UNREACHABLE;
621 624
}
622 625

  
623 626
/*
eval.c (working copy)
516 516
	}
517 517
    }
518 518
    rb_raise_jump(rb_make_exception(argc, argv));
519
    return Qnil;		/* not reached */
519

  
520
    UNREACHABLE;
520 521
}
521 522

  
522 523
static VALUE
process.c (working copy)
2843 2843
    }
2844 2844
    _exit(istatus);
2845 2845

  
2846
    return Qnil;		/* not reached */
2846
    UNREACHABLE;
2847 2847
}
2848 2848

  
2849 2849
void
......
2916 2916
	istatus = EXIT_SUCCESS;
2917 2917
    }
2918 2918
    rb_exit(istatus);
2919
    return Qnil;		/* not reached */
2919

  
2920
    UNREACHABLE;
2920 2921
}
2921 2922

  
2922 2923

  
......
2950 2951
	args[0] = INT2NUM(EXIT_FAILURE);
2951 2952
	rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit));
2952 2953
    }
2953
    return Qnil;		/* not reached */
2954

  
2955
    UNREACHABLE;
2954 2956
}
2955 2957

  
2956 2958
void
ext/-test-/iter/break.c (working copy)
4 4
iter_break_value(VALUE self, VALUE val)
5 5
{
6 6
    rb_iter_break_value(val);
7
    return self;		/* not reached */
7

  
8
    UNREACHABLE;
8 9
}
9 10

  
10 11
void
ext/pty/pty.c (working copy)
687 687

  
688 688
    if (!RTEST(exc)) return rb_last_status_get();
689 689
    raise_from_check(cpid, status);
690
    return Qnil;		/* not reached */
690

  
691
    UNREACHABLE;
691 692
}
692 693

  
693 694
static VALUE cPTY;
ext/openssl/ossl_pkey.c (working copy)
98 98
    default:
99 99
	ossl_raise(ePKeyError, "unsupported key type");
100 100
    }
101
    return Qnil; /* not reached */
101

  
102
    UNREACHABLE;
102 103
}
103 104

  
104 105
VALUE
ext/readline/readline.c (working copy)
1379 1379
    return Qnil;
1380 1380
#else
1381 1381
    rb_notimplement();
1382
    return Qnil; /* not reached */
1382

  
1383
    UNREACHABLE;
1383 1384
#endif
1384 1385
}
1385 1386

  
ext/stringio/stringio.c (working copy)
287 287
{
288 288
    StringIO(self);
289 289
    rb_notimplement();
290
    return Qnil;		/* not reached */
290

  
291
    UNREACHABLE;
291 292
}
292 293

  
293 294
/*
numeric.c (working copy)
260 260
	     "can't define singleton method \"%s\" for %s",
261 261
	     rb_id2name(mid),
262 262
	     rb_obj_classname(x));
263
    return Qnil;		/* not reached */
263

  
264
    UNREACHABLE;
264 265
}
265 266

  
266 267
/* :nodoc: */
......
269 270
{
270 271
    /* Numerics are immutable values, which should not be copied */
271 272
    rb_raise(rb_eTypeError, "can't copy %s", rb_obj_classname(x));
272
    return Qnil;		/* not reached */
273

  
274
    UNREACHABLE;
273 275
}
274 276

  
275 277
/*
......
2089 2091

  
2090 2092
      case T_STRING:
2091 2093
	rb_raise(rb_eTypeError, "no implicit conversion from string");
2092
	return Qnil;            /* not reached */
2094
	break;
2093 2095

  
2094 2096
      case T_TRUE:
2095 2097
      case T_FALSE:
2096 2098
	rb_raise(rb_eTypeError, "no implicit conversion from boolean");
2097
	return Qnil;		/* not reached */
2099
	break;
2098 2100

  
2099 2101
      default:
2100 2102
	val = rb_to_int(val);
2101 2103
	return NUM2LL(val);
2102 2104
    }
2105

  
2106
    UNREACHABLE;
2103 2107
}
2104 2108

  
2105 2109
unsigned LONG_LONG
......
2131 2135

  
2132 2136
      case T_STRING:
2133 2137
	rb_raise(rb_eTypeError, "no implicit conversion from string");
2134
	return Qnil;            /* not reached */
2138
	break;
2135 2139

  
2136 2140
      case T_TRUE:
2137 2141
      case T_FALSE:
2138 2142
	rb_raise(rb_eTypeError, "no implicit conversion from boolean");
2139
	return Qnil;		/* not reached */
2143
	break;
2140 2144

  
2141 2145
      default:
2142 2146
	val = rb_to_int(val);
2143 2147
	return NUM2ULL(val);
2144 2148
    }
2149

  
2150
    UNREACHABLE;
2145 2151
}
2146 2152

  
2147 2153
#endif  /* HAVE_LONG_LONG */
vm_insnhelper.c (working copy)
429 429
	break;
430 430
      default:
431 431
	rb_raise(rb_eArgError, "too many arguments(%d)", len);
432
	return Qundef; /* not reached */
432
	UNREACHABLE;
433 433
    }
434 434
}
435 435

  
ruby.c (working copy)
1749 1749
      case Qtrue:
1750 1750
	return INT2FIX(2);
1751 1751
    }
1752
    return Qnil;		/* not reached */
1752

  
1753
    UNREACHABLE;
1753 1754
}
1754 1755

  
1755 1756
void
bignum.c (working copy)
3671 3671
	rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
3672 3672
		 rb_obj_classname(y));
3673 3673
    }
3674
    /* not reached */
3675
    return Qnil;
3674

  
3675
    UNREACHABLE;
3676 3676
}
3677 3677

  
3678 3678
/*
file.c (working copy)
4386 4386
    else {
4387 4387
	rb_raise(rb_eArgError, "unknown command \"\\x%02X\"", cmd);
4388 4388
    }
4389
    return Qnil;		/* not reached */
4389

  
4390
    UNREACHABLE;
4390 4391
}
4391 4392

  
4392 4393