comparison src/ui/mfw/mfw_tim.c @ 188:92abb46dc1ba

src/ui/mfw/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 06:10:27 +0000
parents 67bfe9f274f6
children
comparison
equal deleted inserted replaced
187:a33dd8a5dcc9 188:92abb46dc1ba
13 EXPORT : 13 EXPORT :
14 14
15 TO DO : 15 TO DO :
16 16
17 $History:: mfw_tim.c $ 17 $History:: mfw_tim.c $
18 * 18 *
19 * ***************** Version 12 ***************** 19 * ***************** Version 12 *****************
20 * User: Es Date: 3.03.00 Time: 12:10 20 * User: Es Date: 3.03.00 Time: 12:10
21 * Updated in $/GSM/Condat/MS/SRC/MFW 21 * Updated in $/GSM/Condat/MS/SRC/MFW
22 * timStart(), timSignal() etc.: safer handling of simultaneous 22 * timStart(), timSignal() etc.: safer handling of simultaneous
23 * timeouts; additional chain in timer control block. 23 * timeouts; additional chain in timer control block.
172 MfwHdr *insert_status =0; 172 MfwHdr *insert_status =0;
173 173
174 if (!hdr || !tim) 174 if (!hdr || !tim)
175 { 175 {
176 TRACE_ERROR("ERROR: timCreate() Mem Alloc Failed."); 176 TRACE_ERROR("ERROR: timCreate() Mem Alloc Failed.");
177 177
178 if(hdr) 178 if(hdr)
179 mfwFree((U8*)hdr,sizeof(MfwHdr)); 179 mfwFree((U8*)hdr,sizeof(MfwHdr));
180 180
181 if(tim) 181 if(tim)
182 mfwFree((U8*)tim,sizeof(MfwTim)); 182 mfwFree((U8*)tim,sizeof(MfwTim));
183 183
184 return 0; 184 return 0;
185 } 185 }
186 186
187 tim->time = t; 187 tim->time = t;
188 tim->left = 0; 188 tim->left = 0;
203 mfwFree((U8*)hdr,sizeof(MfwHdr)); 203 mfwFree((U8*)hdr,sizeof(MfwHdr));
204 mfwFree((U8*)tim,sizeof(MfwTim)); 204 mfwFree((U8*)tim,sizeof(MfwTim));
205 return 0; 205 return 0;
206 } 206 }
207 return insert_status; 207 return insert_status;
208 208
209 209
210 } 210 }
211 211
212 212
213 /* 213 /*
214 +--------------------------------------------------------------------+ 214 +--------------------------------------------------------------------+
436 436
437 while (ActiveTOut && ActiveTOut->left < 0) /* signal timout handlers */ 437 while (ActiveTOut && ActiveTOut->left < 0) /* signal timout handlers */
438 { 438 {
439 ActiveTOut->left = 0; 439 ActiveTOut->left = 0;
440 440
441 /* PATCH PMC 000721: save the next pointer because the memory associated with 441 /* PATCH PMC 000721: save the next pointer because the memory associated with
442 * to may be released in the timer handler function. 442 * to may be released in the timer handler function.
443 */ 443 */
444 timSavedNext = ActiveTOut->next2; 444 timSavedNext = ActiveTOut->next2;
445 /* END PATCH PMC 000721 */ 445 /* END PATCH PMC 000721 */
446 446
447 if (ActiveTOut->handler) 447 if (ActiveTOut->handler)
448 { 448 {
449 // PATCH LE 06.06.00 449 // PATCH LE 06.06.00
450 // store current mfw elem 450 // store current mfw elem
451 current_mfw_elem = ActiveTOut->mfwHeader; /* SPR#1597 - SH - Change mfw_header to mfwHeader */ 451 current_mfw_elem = ActiveTOut->mfwHeader; /* SPR#1597 - SH - Change mfw_header to mfwHeader */
452 // END PATCH LE 06.06.00 452 // END PATCH LE 06.06.00
453 453
454 /* NM, p011b */ 454 /* NM, p011b */
455 temp = dspl_Enable(0); 455 temp = dspl_Enable(0);
456 /* p011b end */ 456 /* p011b end */
457 457
458 (void)((*(ActiveTOut->handler))(ActiveTOut->time,ActiveTOut));/*a0393213 lint warnings removal - void cast is done to avoid lint warning though the function returns int*/ 458 (void)((*(ActiveTOut->handler))(ActiveTOut->time,ActiveTOut));/*a0393213 lint warnings removal - void cast is done to avoid lint warning though the function returns int*/
459 459
460 460
461 /* NM, p011c */ 461 /* NM, p011c */
462 dspl_Enable(temp); 462 dspl_Enable(temp);
463 /* p011c end */ 463 /* p011c end */
464 464
465 } 465 }
466 /* PATCH PMC 000721: use the SavedNext pointer to set ActiveTOut */ 466 /* PATCH PMC 000721: use the SavedNext pointer to set ActiveTOut */
467 ActiveTOut = timSavedNext; 467 ActiveTOut = timSavedNext;
468 /* cq18182 pointer cleared here, this fix is only temporary as it seems to fix the current problem, however further investigation 468 /* cq18182 pointer cleared here, this fix is only temporary as it seems to fix the current problem, however further investigation
469 is required as to why the timSavedNext pointer was not being cleared. 10-03-04 MZ. */ 469 is required as to why the timSavedNext pointer was not being cleared. 10-03-04 MZ. */
520 MfwTim *prev, *curr; 520 MfwTim *prev, *curr;
521 521
522 if (!timRoot) 522 if (!timRoot)
523 { 523 {
524 timRoot = t; 524 timRoot = t;
525 t->next = 0; 525 t->next = 0;
526 t->next2 = 0; /* cq18182 initialise the pointer 10-03-04 MZ. */ 526 t->next2 = 0; /* cq18182 initialise the pointer 10-03-04 MZ. */
527 return; 527 return;
528 } 528 }
529 if (t->left < timRoot->left) 529 if (t->left < timRoot->left)
530 { 530 {
561 MfwTim *timCheck; 561 MfwTim *timCheck;
562 int doneFlag = 0; 562 int doneFlag = 0;
563 563
564 if (t == 0) 564 if (t == 0)
565 return; 565 return;
566 566
567 while (timRoot == t) 567 while (timRoot == t)
568 timRoot = t->next; 568 timRoot = t->next;
569 569
570 if (timRoot) 570 if (timRoot)
571 { 571 {
572 prev = timRoot; 572 prev = timRoot;
573 curr = timRoot->next; 573 curr = timRoot->next;
574 574
597 if(timCheck == NULL || (ULONG)timCheck > 33554432) 597 if(timCheck == NULL || (ULONG)timCheck > 33554432)
598 { /* cq18182 Additional traces to trap pointer overflow. 10-03-04 MZ. */ 598 { /* cq18182 Additional traces to trap pointer overflow. 10-03-04 MZ. */
599 TRACE_EVENT_P1("ERROR: timCheck invalid 0x%08x - mfw_tim.c(593), quit the function", timCheck); 599 TRACE_EVENT_P1("ERROR: timCheck invalid 0x%08x - mfw_tim.c(593), quit the function", timCheck);
600 return; 600 return;
601 } 601 }
602 602
603 603
604 while (timCheck != 0 && !doneFlag) 604 while (timCheck != 0 && !doneFlag)
605 { 605 {
606 606
607 if(timCheck == NULL || (ULONG)timCheck > 33554432) 607 if(timCheck == NULL || (ULONG)timCheck > 33554432)
608 { /* cq18182 Additional traces to trap pointer overflow. 10-03-04 MZ. */ 608 { /* cq18182 Additional traces to trap pointer overflow. 10-03-04 MZ. */
609 TRACE_EVENT_P1("ERROR: timCheck invalid 0x%08x - mfw_tim.c(603), quit the function", timCheck); 609 TRACE_EVENT_P1("ERROR: timCheck invalid 0x%08x - mfw_tim.c(603), quit the function", timCheck);
610 return; 610 return;
611 } 611 }
612 612
613 if (timCheck->next2 == t) 613 if (timCheck->next2 == t)
614 { 614 {
615 timCheck->next2 = t->next2; 615 timCheck->next2 = t->next2;
616 616
617 doneFlag = (int)1; 617 doneFlag = (int)1;
622 { /* cq18182 Additional traces to trap pointer overflow. 10-03-04 MZ. */ 622 { /* cq18182 Additional traces to trap pointer overflow. 10-03-04 MZ. */
623 TRACE_EVENT_P1("ERROR: timCheck invalid 0x%08x - mfw_tim.c(617), quit the function", timCheck); 623 TRACE_EVENT_P1("ERROR: timCheck invalid 0x%08x - mfw_tim.c(617), quit the function", timCheck);
624 return; 624 return;
625 } 625 }
626 timCheck = timCheck->next2; 626 timCheck = timCheck->next2;
627 627
628 } 628 }
629 } 629 }
630 } 630 }
631 } 631 }
632 } 632 }