PATCH: Remove compile time warning from tc-tic4x.c

Nick Clifton nickc@redhat.com
Tue Feb 12 08:35:00 GMT 2008


Hi Guys,

   I am checking in another patch to fix a gcc 4.2.1 generated compile 
time warning message about dropping a const qualifier, this time in 
tc-tic4x.c.

Cheers
   Nick

gas/ChangeLog
2008-02-12  Nick Clifton  <nickc@redhat.com>

	* config/tc-tic4x.c (tic4x_insn_insert): Add const qualifier to
	argument.
	(tic4x_insn_add): Likewise.
	(md_begin): Drop cast that was discarding a const qualifier.

Index: gas/config/tc-tic4x.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-tic4x.c,v
retrieving revision 1.23
diff -c -3 -p -r1.23 tc-tic4x.c
*** gas/config/tc-tic4x.c	17 Oct 2007 16:45:55 -0000	1.23
--- gas/config/tc-tic4x.c	12 Feb 2008 08:33:18 -0000
*************** static void tic4x_init_regtable
*** 186,197 ****
     PARAMS ((void));
   static void tic4x_init_symbols
     PARAMS ((void));
! static int tic4x_inst_insert
!   PARAMS ((tic4x_inst_t *));
   static tic4x_inst_t *tic4x_inst_make
     PARAMS ((char *, unsigned long, char *));
! static int tic4x_inst_add
!   PARAMS ((tic4x_inst_t *));
   void tic4x_end
     PARAMS ((void));
   static int tic4x_indirect_parse
--- 186,195 ----
     PARAMS ((void));
   static void tic4x_init_symbols
     PARAMS ((void));
! static int tic4x_inst_insert (const tic4x_inst_t *);
   static tic4x_inst_t *tic4x_inst_make
     PARAMS ((char *, unsigned long, char *));
! static int tic4x_inst_add (const tic4x_inst_t *);
   void tic4x_end
     PARAMS ((void));
   static int tic4x_indirect_parse
*************** tic4x_init_symbols ()
*** 1314,1321 ****

   /* Insert a new instruction template into hash table.  */
   static int
! tic4x_inst_insert (inst)
!      tic4x_inst_t *inst;
   {
     static char prev_name[16];
     const char *retval = NULL;
--- 1312,1318 ----

   /* Insert a new instruction template into hash table.  */
   static int
! tic4x_inst_insert (const tic4x_inst_t *inst)
   {
     static char prev_name[16];
     const char *retval = NULL;
*************** tic4x_inst_make (name, opcode, args)
*** 1368,1375 ****

   /* Add instruction template, creating dynamic templates as required.  */
   static int
! tic4x_inst_add (insts)
!      tic4x_inst_t *insts;
   {
     char *s = insts->name;
     char *d;
--- 1365,1371 ----

   /* Add instruction template, creating dynamic templates as required.  */
   static int
! tic4x_inst_add (const tic4x_inst_t *insts)
   {
     char *s = insts->name;
     char *d;
*************** md_begin ()
*** 1481,1487 ****

     /* Add mnemonics to hash table, expanding conditional mnemonics on 
fly.  */
     for (i = 0; i < tic4x_num_insts; i++)
!     ok &= tic4x_inst_add ((void *) &tic4x_insts[i]);

     /* Create dummy inst to avoid errors accessing end of table.  */
     tic4x_inst_make ("", 0, "");
--- 1477,1483 ----

     /* Add mnemonics to hash table, expanding conditional mnemonics on 
fly.  */
     for (i = 0; i < tic4x_num_insts; i++)
!     ok &= tic4x_inst_add (tic4x_insts + i);

     /* Create dummy inst to avoid errors accessing end of table.  */
     tic4x_inst_make ("", 0, "");



More information about the Binutils mailing list