comparison dwtestoo.cpp @ 2934:6d3da42f63af

C++: Fix a couple issues reported by GCC 6 on PPC Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 31 Dec 2022 00:54:00 +0000
parents 3cdb02171b01
children 440de3640522
comparison
equal deleted inserted replaced
2933:3cdb02171b01 2934:6d3da42f63af
466 snprintf(font, 100, "%d.%s", fontsize, fontname); 466 snprintf(font, 100, "%d.%s", fontsize, fontname);
467 mle->SetFont(fontname ? font : NULL); 467 mle->SetFont(fontname ? font : NULL);
468 } 468 }
469 469
470 // Thread and Event functions 470 // Thread and Event functions
471 void UpdateMLE(DW::MLE *threadmle, char *text, DW::Mutex *mutex) 471 void UpdateMLE(DW::MLE *threadmle, const char *text, DW::Mutex *mutex)
472 { 472 {
473 static unsigned int pos = 0; 473 static unsigned int pos = 0;
474 474
475 // Protect pos from being changed by different threads 475 // Protect pos from being changed by different threads
476 if(mutex) 476 if(mutex)
486 486
487 snprintf(buf, BUF_SIZE, "Thread %d started.\r\n", threadnum); 487 snprintf(buf, BUF_SIZE, "Thread %d started.\r\n", threadnum);
488 UpdateMLE(threadmle, buf, mutex); 488 UpdateMLE(threadmle, buf, mutex);
489 489
490 // Increment the ready count while protected by mutex 490 // Increment the ready count while protected by mutex
491 dw_mutex_lock(mutex); 491 mutex->Lock();
492 ready++; 492 ready++;
493 // If all 4 threads have incrememted the ready count... 493 // If all 4 threads have incrememted the ready count...
494 // Post the control event semaphore so things will get started. 494 // Post the control event semaphore so things will get started.
495 if(ready == 4) 495 if(ready == 4)
496 controlevent->Post(); 496 controlevent->Post();