summaryrefslogtreecommitdiff
blob: d35af9f69a69c232258acd0bd9a52012bc5dcfb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
Fix various QA issues:
* Use correct printf format specifiers for 'size_t'
* Fix const correctness ('char*' -> 'const char*') for C-string literals
* Correctly forward declare inline functions

--- a/fire/test-fire.cc
+++ b/fire/test-fire.cc
@@ -24,7 +24,7 @@
       if (k->size < (size_t) N)
 	sizes[k->size]++;
       if (k->size % 4 !=0)
-	printf ("odd size: %d\n", k->size);
+	printf ("odd size: %zu\n", k->size);
     }
   printf ("min = %d, max = %d\n", min, max);
   for (int i = min; i <= max && i < N; i+=4)
--- a/fire/tree-supp.cc
+++ b/fire/tree-supp.cc
@@ -485,7 +485,7 @@
   if (size < (size_t) N)
     sizes[size]++;
   if (size % 4 !=0)
-    printf ("odd size: %d\n", size);
+    printf ("odd size: %zu\n", size);
 }
  
 void
--- a/freehdl/kernel-dump.hh
+++ b/freehdl/kernel-dump.hh
@@ -42,9 +42,9 @@
   short wait_id;
   // This function will return an appropriate table entry (if
   // available)
-  char *find_table(type_info_interface* type);
+  const char *find_table(type_info_interface* type);
   //this variable is used by the read_type function
-  char* translation_table;
+  const char* translation_table;
   // This method is executed each time the signal value changes
   bool execute();
   // Continue dumping the signal.
@@ -77,7 +77,7 @@
 extern list<signal_dump*> signal_dump_process_list;
 
 // Used to store the user_defined translation table types
-extern  map<string, char*, less<string> >  mapping_translation_table;
+extern  map<string, const char*, less<string> >  mapping_translation_table;
 
 
 /******************************************************
--- a/freehdl/kernel-fhdl-stream.hh
+++ b/freehdl/kernel-fhdl-stream.hh
@@ -29,7 +31,7 @@
       str->flush();
   }
 
-  fhdl_ostream_t &operator<<(char *p);
+  fhdl_ostream_t &operator<<(const char *p);
   fhdl_ostream_t &operator<<(const string &a);
   fhdl_ostream_t &operator<<(const int i);
   fhdl_ostream_t &operator<<(const unsigned int i);
--- a/freehdl/std-vhdl-types.hh
+++ b/freehdl/std-vhdl-types.hh
@@ -607,7 +618,7 @@
   // which caused the failure or NULL otherwise.
   virtual const char *read(void *dest, const char *str) = 0;
   // Prints the content of src into an string stream in VCD format
-  virtual void vcd_print(buffer_stream &str, const void *src,char* translation_table, bool pure) = 0;
+  virtual void vcd_print(buffer_stream &str, const void *src, const char* translation_table, bool pure) = 0;
   // Prints value into binary stream. Note that only the raw data but
   // no type info objects are written! The method returns the number
   // of bytes written to the stream.
@@ -785,7 +796,7 @@
   bool assign(void *dest, const void *src);
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode);
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure);
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure);
   const char *read(void *dest, const char *str);
 
   integer check(integer value) {
@@ -821,7 +832,7 @@
   bool assign(void *dest, const void *src);
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode);
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure) {};
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure) {};
   const char *read(void *dest, const char *str);
 };
 
@@ -849,7 +860,7 @@
   bool assign(void *dest, const void *src);
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode) {};
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure) {};
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure) {};
   const char *read(void *dest, const char *str);
 };
 
@@ -879,7 +890,7 @@
   bool assign(void *dest, const void *src);
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode);
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure);
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure);
   const char *read(void *dest, const char *str);
 
   floatingpoint check(floatingpoint value) {
@@ -914,7 +925,7 @@
   bool assign(void *dest, const void *src);
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode);
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure);
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure);
   const char *read(void *dest, const char *str);
 
   enumeration check(integer value) {
@@ -954,7 +965,7 @@
   bool assign(void *dest, const void *src);
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode);
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure) ;
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure) ;
   const char *read(void *dest, const char *str);
    
   physical check(physical value) {
@@ -1087,7 +1098,7 @@
   bool assign(void *dest, const void *src) { return false; };
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode);
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure) ;
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure) ;
   const char *read(void *dest, const char *str);
 };
 
@@ -1230,7 +1241,7 @@
   bool assign(void *dest, const void *src) { return false; };
   void remove(void *src);
   void print(buffer_stream &str, const void *src, int mode);
-  void vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure);
+  void vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure);
   const char *read(void *dest, const char *str);
 };
 
--- a/freehdl/vaul-lexer.h
+++ b/freehdl/vaul-lexer.h
@@ -115,7 +114,7 @@
   IR_String expand_bitstring(const char *, int len);
   
   int LexerInput(char *buf, int max_size);
-  void LexerError(char *msg);
+  void LexerError(const char *msg);
   void message(char *fmt, va_list ap);
   void message(vaul_yyltype &loc, char *fmt, va_list ap);
 
--- a/kernel/driver_info.cc
+++ b/kernel/driver_info.cc
@@ -270,6 +270,7 @@
 
 
 // Creates transaction composite signals. Returns number of assigned scalars.
+inline int do_record_transport_assignment(driver_info &, const record_base &, int, const vtime &);
 inline int
 do_array_transport_assignment(driver_info &driver, const array_base &value, int first, const vtime &tr_time) 
 {
@@ -311,7 +312,6 @@
 	assigned_scalars += do_array_transport_assignment(driver, (array_base&)value.data[j], i, tr_time);
 	break;
       case RECORD:
-	inline int do_record_transport_assignment(driver_info &, const record_base &, int, const vtime &);
 	assigned_scalars += do_record_transport_assignment(driver, (record_base&)value.data[j], i, tr_time);
 	break;
       }
@@ -339,6 +339,7 @@
 
 
 // Creates transaction for composite signals. Returns number of assigned scalars.
+inline int do_record_inertial_assignment(driver_info &, const record_base &, int, const vtime &, const vtime &); 
 inline int
 do_array_inertial_assignment(driver_info &driver,
 			     const array_base &value, int first, 
@@ -381,8 +382,6 @@
 	assigned_scalars += do_array_inertial_assignment(driver, (array_base&)value.data[j], i, tr_time, rm_time);
 	break;
       case RECORD:
-	inline int do_record_inertial_assignment(driver_info &, const record_base &, int,  
-						  const vtime &, const vtime &); 
 	assigned_scalars += do_record_inertial_assignment(driver, (record_base&)value.data[j], i, tr_time, rm_time);
 	break;
       }
--- a/kernel/dump.cc
+++ b/kernel/dump.cc
@@ -90,7 +90,7 @@
 
 
 // find_translation table
-char *
+const char *
 signal_dump::find_table(type_info_interface* type)
 {
   switch(type->id)
--- a/kernel/fhdl_stream.cc
+++ b/kernel/fhdl_stream.cc
@@ -60,7 +63,7 @@
 }
 
 fhdl_ostream_t &
-fhdl_ostream_t::operator<<(char *p) 
+fhdl_ostream_t::operator<<(const char *p) 
 {
   if (!socket_connection)
     *str << p;
--- a/std/vhdl_types.cc
+++ b/std/vhdl_types.cc
@@ -1013,7 +1016,7 @@
 }
 
 void
-integer_info_base::vcd_print(buffer_stream  &str, const void *src,char* translation_table,  bool pure) 
+integer_info_base::vcd_print(buffer_stream  &str, const void *src, const char* translation_table,  bool pure) 
 {
  integer op =*((integer*)src);
  static char result[INTEGER_SIZE_LD + 1];
@@ -1306,7 +1309,7 @@
 }
 
 void
-float_info_base::vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure) {
+float_info_base::vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure) {
   // should be definitly enough characters to hold a string
   // representation of a double
   static char rbuffer[8*sizeof(double)]; 
@@ -1432,7 +1435,7 @@
 
 
 void
-enum_info_base::vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure) 
+enum_info_base::vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure) 
 {
   if (translation_table != NULL) {
     const char output = translation_table[*((enumeration*)src)];
@@ -1583,7 +1586,7 @@
 }
 
 void
-physical_info_base::vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure) {
+physical_info_base::vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure) {
   str << *((physical*)src) << " " << units[0];
 }
 
@@ -1778,7 +1781,7 @@
 }
 
 // Temporary VCD_Print function
-void array_info::vcd_print(buffer_stream  &str, const void *src,char* translation_table, bool pure)
+void array_info::vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure)
 {
   //str.clean();
   int length = ((array_base*)src)->info->length;
@@ -2090,7 +2093,7 @@
 
 
 // Temporary VCD_Print function
-void record_info::vcd_print(buffer_stream  &str, const void *src, char* translation_table, bool pure)
+void record_info::vcd_print(buffer_stream  &str, const void *src, const char* translation_table, bool pure)
 {
   record_base &record = *(record_base*)src;
   record_info &rinfo = *record.info;
--- a/vaul/lexer.cc
+++ b/vaul/lexer.cc
@@ -2075,7 +2075,7 @@
 }
 
 void
-vaul_lexer::LexerError (char *m)
+vaul_lexer::LexerError (const char *m)
 {
   if (prt)
     prt->fprintf (log, "%?%s %C\n", this, m, this);