cvsuser 05/04/09 03:02:43
Modified: ast node.c
charset ascii.c
classes fixedbooleanarray.pmc fixedpmcarray.pmc hash.pmc
integer.pmc parrotclass.pmc parrotthread.pmc
scratchpad.pmc tqueue.pmc unmanagedstruct.pmc
ops io.ops string.ops
src string.c
Log:
[perl #34894] [PATCH] remove warnings from classes/*.pmc
this patch removes uninitialized variable warnings from the following:
...
[ plus missing string.c from previous patch --leo ]
Courtesy of Jerry Gay <[EMAIL PROTECTED]>
Revision Changes Path
1.29 +13 -8 parrot/ast/node.c
Index: node.c
===================================================================
RCS file: /cvs/public/parrot/ast/node.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- node.c 5 Dec 2004 08:29:27 -0000 1.28
+++ node.c 9 Apr 2005 10:02:35 -0000 1.29
@@ -127,7 +127,7 @@
ctx_default(nodeType *p, context_type outer)
{
context_type inner = CTX_UNK;
- nodeType *child, *next;
+ nodeType *child;
for (; p; p = p->next) {
p->up_ctx = outer;
@@ -503,7 +503,6 @@
lr = rhs->expand(interpreter, rhs);
}
else if (rhs->expand == exp_Const) {
- const char *pmc;
/* need a new value, because the name might be aliased by
* a = b
*/
@@ -556,7 +555,6 @@
nodeType *op, *left, *right;
Instruction *ins;
SymReg *regs[IMCC_MAX_REGS];
- char buf[128];
SymReg *lr, *rr, *dest;
op = CHILD(p);
@@ -606,7 +604,6 @@
nodeType *op, *arg;
Instruction *ins;
SymReg *regs[IMCC_MAX_REGS];
- char buf[128];
SymReg *rr, *dest;
op = CHILD(p);
@@ -810,7 +807,9 @@
{
nodeType *name, *args;
Instruction *ins;
- SymReg *regs[IMCC_MAX_REGS];
+/* TODO
+ * SymReg *regs[IMCC_MAX_REGS];
+ */
name = CHILD(p);
args = name->next;
@@ -857,7 +856,10 @@
static SymReg*
exp_PCC_Sub(Interp* interpreter, nodeType *p)
{
- nodeType *doc;
+/*
+ * TODO
+ * nodeType *doc;
+ */
SymReg *sub;
Instruction *ins;
SymReg *regs[IMCC_MAX_REGS];
@@ -889,7 +891,10 @@
static SymReg*
exp_Py_Module(Interp* interpreter, nodeType *p)
{
- nodeType *doc;
+/*
+ * TODO
+ * nodeType *doc;
+ */
SymReg *sub;
Instruction *ins;
SymReg *regs[IMCC_MAX_REGS];
1.20 +1 -5 parrot/charset/ascii.c
Index: ascii.c
===================================================================
RCS file: /cvs/public/parrot/charset/ascii.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ascii.c 6 Apr 2005 10:27:51 -0000 1.19
+++ ascii.c 9 Apr 2005 10:02:37 -0000 1.20
@@ -366,8 +366,6 @@
ascii_cs_index(Interp *interpreter, STRING *source_string,
STRING *search_string, UINTVAL offset)
{
- UINTVAL base_size, search_size;
- char *base, *search;
INTVAL retval;
if (source_string->charset != search_string->charset) {
return mixed_cs_index(interpreter, source_string, search_string,
@@ -383,8 +381,6 @@
INTVAL
ascii_cs_rindex(Interp *interpreter, STRING *source_string,
STRING *search_string, UINTVAL offset) {
- UINTVAL base_size, search_size;
- char *base, *search;
INTVAL retval;
if (source_string->charset != search_string->charset) {
internal_exception(UNIMPLEMENTED, "Cross-charset index not
supported");
1.9 +1 -3 parrot/classes/fixedbooleanarray.pmc
Index: fixedbooleanarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/fixedbooleanarray.pmc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- fixedbooleanarray.pmc 30 Mar 2005 07:56:16 -0000 1.8
+++ fixedbooleanarray.pmc 9 Apr 2005 10:02:38 -0000 1.9
@@ -119,7 +119,6 @@
*/
PMC* clone () {
- INTVAL size;
PMC * dest = pmc_new(INTERP, SELF->vtable->base_type);
PMC_int_val(dest) = PMC_int_val(SELF);
@@ -309,7 +308,6 @@
*/
void set_integer_native (INTVAL size) {
- Parrot_UInt1 *sd;
if (PMC_int_val(SELF) || size < 1)
internal_exception(OUT_OF_BOUNDS, "FixedBooleanArray: Can't
resize!");
1.35 +2 -2 parrot/classes/fixedpmcarray.pmc
Index: fixedpmcarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/fixedpmcarray.pmc,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- fixedpmcarray.pmc 5 Apr 2005 14:07:34 -0000 1.34
+++ fixedpmcarray.pmc 9 Apr 2005 10:02:38 -0000 1.35
@@ -240,7 +240,7 @@
}
STRING* get_repr () {
- STRING *res, *s;
+ STRING *res;
INTVAL j, n;
PMC *val;
1.8 +2 -4 parrot/classes/hash.pmc
Index: hash.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/hash.pmc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- hash.pmc 5 Apr 2005 14:07:34 -0000 1.7
+++ hash.pmc 9 Apr 2005 10:02:38 -0000 1.8
@@ -420,7 +420,7 @@
STRING* get_repr () {
/* TODO use freeze */
PMC *iter = VTABLE_get_iter(INTERP, SELF);
- STRING *res, *s;
+ STRING *res;
INTVAL j, n;
res = string_from_cstring(INTERP, "{", 0);
@@ -611,7 +611,6 @@
}
PMC* get_pmc_keyed (PMC* key) {
- PMC* valpmc;
STRING* keystr;
Hash *hash = PMC_struct_val(SELF);
HashBucket *b;
@@ -813,7 +812,6 @@
STRING* keystr;
PMC* nextkey;
PMC* box;
- PMC* val;
if (!key) return;
keystr = make_hash_key(INTERP, key);
1.29 +2 -2 parrot/classes/integer.pmc
Index: integer.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/integer.pmc,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- integer.pmc 8 Apr 2005 10:17:00 -0000 1.28
+++ integer.pmc 9 Apr 2005 10:02:38 -0000 1.29
@@ -689,7 +689,7 @@
*/
void divide_int (INTVAL value, PMC* dest) {
INTVAL pmci, divi;
- FLOATVAL valf, divf;
+ FLOATVAL divf;
pmci = PMC_int_val(SELF);
/* TODO exception */
1.36 +2 -3 parrot/classes/parrotclass.pmc
Index: parrotclass.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/parrotclass.pmc,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- parrotclass.pmc 4 Apr 2005 14:02:16 -0000 1.35
+++ parrotclass.pmc 9 Apr 2005 10:02:38 -0000 1.36
@@ -197,7 +197,7 @@
*
* So here's the plan:
* During thaw, we first extend the class_data by two,
- * thaw parents and attribs into that new arrea, and
+ * thaw parents and attribs into that new area, and
* then we see what to do.
*/
if (info->extra_flags == EXTRA_IS_PROP_HASH) {
@@ -206,7 +206,6 @@
else if (info->extra_flags == EXTRA_IS_NULL) {
STRING *class_name;
INTVAL new_type;
- PMC *ar;
PMC *real_class;
/* thaw class name */
1.12 +1 -2 parrot/classes/parrotthread.pmc
Index: parrotthread.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/parrotthread.pmc,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- parrotthread.pmc 12 Jan 2005 11:42:06 -0000 1.11
+++ parrotthread.pmc 9 Apr 2005 10:02:38 -0000 1.12
@@ -53,7 +53,6 @@
*/
void init () {
- PMC *parent;
/*
* protect interpreter creation and list handling
*/
1.22 +1 -2 parrot/classes/scratchpad.pmc
Index: scratchpad.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/scratchpad.pmc,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- scratchpad.pmc 24 Mar 2005 14:08:15 -0000 1.21
+++ scratchpad.pmc 9 Apr 2005 10:02:38 -0000 1.22
@@ -176,7 +176,6 @@
void delete_keyed(PMC* key) {
STRING * name = NULL;
INTVAL position;
- struct Parrot_Lexicals * lex;
if (key_type(INTERP, key) == KEY_integer_FLAG) {
position = key_integer(INTERP, key);
1.10 +1 -2 parrot/classes/tqueue.pmc
Index: tqueue.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/tqueue.pmc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- tqueue.pmc 20 Aug 2004 11:25:36 -0000 1.9
+++ tqueue.pmc 9 Apr 2005 10:02:38 -0000 1.10
@@ -79,7 +79,6 @@
void mark () {
QUEUE *queue = PMC_data(SELF);
QUEUE_ENTRY *entry;
- PMC *val;
queue_lock(queue);
entry = queue->head;
1.50 +2 -4 parrot/classes/unmanagedstruct.pmc
Index: unmanagedstruct.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/unmanagedstruct.pmc,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- unmanagedstruct.pmc 12 Jan 2005 11:42:06 -0000 1.49
+++ unmanagedstruct.pmc 9 Apr 2005 10:02:38 -0000 1.50
@@ -115,7 +115,7 @@
static char *
char_offset_key(Interp* interpreter, PMC *pmc, PMC *key, int *type)
{
- size_t offs, n, count, size, max;
+ size_t offs, count, size, max;
PMC *next, *init, *outer_init;
int ix;
char *p;
@@ -325,8 +325,6 @@
static PMC*
ret_pmc(Interp* interpreter, PMC* pmc, char *p, int type, INTVAL idx)
{
- char *cstr;
- size_t len;
PMC *ret = NULL, *init, *ptr;
switch (type) {
1.55 +0 -1 parrot/ops/io.ops
Index: io.ops
===================================================================
RCS file: /cvs/public/parrot/ops/io.ops,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- io.ops 14 Feb 2005 10:57:23 -0000 1.54
+++ io.ops 9 Apr 2005 10:02:42 -0000 1.55
@@ -340,7 +340,6 @@
=cut
op read(out STR, in INT) :base_io {
- UINTVAL n;
$1 = PIO_reads(interpreter, PIO_STDIN(interpreter), (size_t)$2);
goto NEXT();
}
1.39 +0 -1 parrot/ops/string.ops
Index: string.ops
===================================================================
RCS file: /cvs/public/parrot/ops/string.ops,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- string.ops 8 Apr 2005 10:17:12 -0000 1.38
+++ string.ops 9 Apr 2005 10:02:42 -0000 1.39
@@ -346,7 +346,6 @@
inline op pack(inout STR, in INT, in STR) :base_core {
STRING *t,*s = $3;
UINTVAL len = (UINTVAL)$2;
- char buf[3];
if (s->strlen < len) { /* XXXX: what is this supposed to do? */
STRING *temp;
1.249 +1 -10 parrot/src/string.c
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/src/string.c,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -r1.248 -r1.249
--- string.c 9 Apr 2005 08:21:27 -0000 1.248
+++ string.c 9 Apr 2005 10:02:43 -0000 1.249
@@ -2374,9 +2374,6 @@
void
string_upcase_inplace(Interp *interpreter, STRING *s)
{
- UINTVAL i;
- INTVAL o;
-
if (!s)
return;
CHARSET_UPCASE(interpreter, s);
@@ -2420,9 +2417,6 @@
void
string_downcase_inplace(Interp *interpreter, STRING *s)
{
- UINTVAL i;
- INTVAL o;
-
if (!s)
return;
CHARSET_DOWNCASE(interpreter, s);
@@ -2466,9 +2460,6 @@
void
string_titlecase_inplace(Interp *interpreter, STRING *s)
{
- UINTVAL i;
- INTVAL o;
-
if (!s)
return;
CHARSET_TITLECASE(interpreter, s);