Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Useless Assignment  at trcfile.c:149

Categories: LANG.STRUCT.UA
Warning ID: 2855.2918
Procedure: trc_add_tevdesc
Trace: View
Modified: Wed Sep 2 12:50:33 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
LineSource
  /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcfile.c
  Enter trc_add_tevdesc
114 trc_add_tevdesc( ID, TDptr, tid, omit ) 
115 TRC_ID ID;
116 TRC_TEVDESC *TDptr;
117 int tid;
118 int omit;
119 {
120         TRC_TEVDESC *newlist;
121  
122         TRC_TEVDESC tdptr;
123         TRC_TEVDESC last;
124  
125         int newsize;
126         int index;
127         int eid;
128         int i;
129  
130         /* Verify Descriptor List is Large Enough */ 
131  
132         eid = (*TDptr)->eid;
133  
134         if ( eid >= TRC_TEVDESC_SIZE )
135         {
136                 newsize = 2 * ( eid + 1 );
137  
138                 newlist = (TRC_TEVDESC *) malloc( (unsigned) newsize 
139                         * sizeof( TRC_TEVDESC ) );
140                 trc_memcheck( newlist, "New TRC_TEVDESC Pointer List);
141  
142                 for ( i=0 ; i < TRC_TEVDESC_SIZE ; i++ )
143                 {
144                         newlist[i] = TRC_TEVDESC_LIST[i];
145  
146                         TRC_TEVDESC_LIST[i] = (TRC_TEVDESC) NULL;
147                 }
148  
149                 i = ( TRC_TEVDESC_SIZE >= 0 ) ? TRC_TEVDESC_SIZE : 0;     /* Useless Assignment */
150  
151                 while ( i < newsize )
152                 {
153                         newlist[i] = (TRC_TEVDESC) NULL;
154  
155                         i++;
156                 }
157  
158                 freeTRC_TEVDESC_LIST );
159  
160                 TRC_TEVDESC_LIST = newlist;
161  
162                 TRC_TEVDESC_SIZE = newsize;
163         }
164  
165         /* Search for Existing Descriptor */ 
166  
167         tdptr = TRC_TEVDESC_LIST[ eid ];   /* Uninitialized Variable (ID: 2856.2919) */  /* Buffer Underrun (ID: 2857.2920) */
168  
169         last = (TRC_TEVDESC) NULL;
170  
171         index = 0;
172  
173         while ( tdptr != NULL )
174         {
175                 if ( trc_cmp_tevdesc( *TDptr, tdptr ) )
176                 {
177                         if ( !omit && tdptr->dump && ID != NULL )
178                                 trc_dump_tevdesc( ID, tdptr, tid );
179  
180                         (*TDptr)->index = tdptr->index;
181  
182                         if ( ID != NULL )
183                                 trc_store_data_values( ID, *TDptr, tid, omit );
184  
185                         trc_free_tevdesc( TDptr );
186  
187                         *TDptr = tdptr;
188  
189                         (tdptr->refcount)++;
190  
191                         return( TRC_FALSE );
192                 }
193  
194                 index++;
195  
196                 last = tdptr;
197  
198                 tdptr = tdptr->next;
199         }
200  
201         /* Add New Descriptor */ 
202  
203         if ( last != NULL )
204                 last->next = *TDptr;
205  
206         else 
207                 TRC_TEVDESC_LIST[ eid ] = *TDptr;
208  
209         (*TDptr)->index = index;
210  
211         if ( omit )
212                 (*TDptr)->dump = TRC_FALSE;
213  
214         else 
215                 (*TDptr)->dump = TRC_TRUE;
216  
217         return( TRC_TRUE );
218 




Change Warning 2855.2918 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: