return do_array(ex, tpp);
/* catch initialisations like char s[] = "I am a string" */
if (tp->tp_up->tp_fund == CHAR && ex->ex_class == String)
- init_string(tpp, ex);
+ ch_array(tpp, ex);
else /* " int i[24] = 12;" */
check_and_pad(ex, tpp);
break;
f = f->OP_LEFT;
}
if (f->ex_class == String) { /* hallelujah, it's a string! */
- init_string(tpp, f);
+ ch_array(tpp, f);
return g ? g->OP_RIGHT : ex->OP_RIGHT;
}
/* else: just go on with the next part of this function */
}
}
-/* init_string() initialises an array of characters by specifying
+/* ch_array() initialises an array of characters when given
a string constant.
Alignment is taken care of.
*/
-init_string(tpp, ex)
+ch_array(tpp, ex)
struct type **tpp; /* type tp = array of characters */
struct expr *ex;
{
con_nullbyte();
}
+str_cst(str, len)
+ register char *str;
+ register int len;
+{
+ while (len-- > 0)
+ C_con_ucon(long2str((long)*str++ & 0xFF, 10), (arith)1);
+}
+
#ifndef NOBITFIELD
/* put_bf() takes care of the initialisation of (bit-)field
selectors of a struct: each time such an initialisation takes place,