#include <stdio.h>
#include <unistd.h>
-#include <assert.h>
#include <lib/base/eerror.h>
void eThread::thread_completed(void *ptr)
if (!p->m_state.value())
{
p->m_state.up();
- assert(p->m_state.value() == 1);
+ ASSERT(p->m_state.value() == 1);
}
p->thread_finished();
return -1;
eDebug("after: %d", m_state.value());
- assert(m_state.value() == 1); /* sync postconditions */
- assert(!m_alive);
+ ASSERT(m_state.value() == 1); /* sync postconditions */
+ ASSERT(!m_alive);
m_state.down();
m_alive = 1;
int res;
m_state.down(); /* this might block */
res = m_alive;
- assert(m_state.value() == 0);
+ ASSERT(m_state.value() == 0);
m_state.up();
return res; /* 0: thread is guaranteed not to run. 1: state unknown. */
}
void eThread::hasStarted()
{
- assert(!m_state.value());
+ ASSERT(!m_state.value());
m_state.up();
}
{
channel ch;
std::map<eDVBChannelID, channel>::iterator it = m_channels.find(id);
- assert(feparm);
+ ASSERT(feparm);
ch.m_frontendParameters = feparm;
if (it != m_channels.end())
it->second = ch;
void eCueSheet::addSourceSpan(const pts_t &begin, const pts_t &end)
{
- assert(begin < end);
+ ASSERT(begin < end);
m_lock.WrLock();
m_spans.push_back(std::pair<pts_t, pts_t>(begin, end));
m_lock.Unlock();
RESULT eDVBScan::startFilter()
{
bool startSDT=true;
- assert(m_demux);
+ ASSERT(m_demux);
/* only start required filters filter */
{
std::vector<ProgramAssociationSection*>::const_iterator i =
m_PAT->getSections().begin();
- assert(i != m_PAT->getSections().end());
+ ASSERT(i != m_PAT->getSections().end());
tsid = (*i)->getTableIdExtension(); // in PAT this is the transport stream id
m_pat_tsid = eTransportStreamID(tsid);
for (; i != m_PAT->getSections().end(); ++i)
{
ePtr<eTextPara> para = new eTextPara(o->parm.renderText->area);
int flags = o->parm.renderText->flags;
- assert(m_current_font);
+ ASSERT(m_current_font);
para->setFont(m_current_font);
para->renderString(o->parm.renderText->text, (flags & gPainter::RT_WRAP) ? RS_WRAP : 0);
if (o->parm.renderText->text)
{
// Figure out how many rectangles are in the band.
unsigned int numRects = curStart - prevStart;
- assert(numRects == rects.size() - curStart);
+ ASSERT(numRects == rects.size() - curStart);
if (!numRects)
return curStart;
std::vector<eRect>::iterator prevBox = rects.begin() + prevStart;
std::vector<eRect>::const_iterator rEnd, int y1, int y2)
{
int newRects = rEnd - r;
- assert(y1 < y2);
- assert(newRects != 0);
+ ASSERT(y1 < y2);
+ ASSERT(newRects != 0);
rects.reserve(rects.size() + newRects);
do {
- assert(r->x1 < r->x2);
+ ASSERT(r->x1 < r->x2);
rects.push_back(eRect(r->x1, y1, r->x2 - r->x1, y2 - y1));
r++;
} while (r != rEnd);
{
int x1, x2;
- assert(y1 < y2);
- assert(r1 != r1End && r2 != r2End);
+ ASSERT(y1 < y2);
+ ASSERT(r1 != r1End && r2 != r2End);
do {
x1 = max(r1->x1, r2->x1);
int x1;
x1 = r1->x1;
- assert(y1<y2);
- assert(r1 != r1End && r2 != r2End);
+ ASSERT(y1<y2);
+ ASSERT(r1 != r1End && r2 != r2End);
do {
if (r2->x2 <= x1)
} else
++r2;
} else if (r2->x1 < r1->x2) {
- assert(x1<r2->x1);
+ ASSERT(x1<r2->x1);
rects.push_back(eRect(x1, y1, r2->x1 - x1, y2 - y1));
x1 = r2->x2;
if (x1 >= r1->x2) {
} while ((r1 != r1End) && (r2 != r2End));
while (r1 != r1End)
{
- assert(x1<r1->x2);
+ ASSERT(x1<r1->x2);
rects.push_back(eRect(x1, y1, r1->x2 - x1, y2 - y1));
++r1;
if (r1 != r1End)
{
int x1, x2;
- assert(y1 < y2);
- assert(r1 != r1End && r2 != r2End);
+ ASSERT(y1 < y2);
+ ASSERT(r1 != r1End && r2 != r2End);
if (r1->x1 < r2->x1)
{
int newSize = reg1.rects.size();
int numRects = reg2.rects.size();
- assert(r1 != r1End);
- assert(r2 != r2End);
+ ASSERT(r1 != r1End);
+ ASSERT(r2 != r2End);
if (numRects > newSize)
newSize = numRects;
int ybot = min(r1->y1, r2->y1);
prevBand = 0;
do {
- assert(r1 != r1End);
- assert(r2 != r2End);
+ ASSERT(r1 != r1End);
+ ASSERT(r2 != r2End);
FindBand(r1, r1BandEnd, r1End, r1y1);
FindBand(r2, r2BandEnd, r2End, r2y1);
if (r1y1 < r2y1) {
mergeO(r1, r1BandEnd, r2, r2BandEnd, ytop, ybot, overlap);
break;
default:
- assert(0);
+ ASSERT(0);
break;
}
coalesce(prevBand, curBand);
m_cursor++;
- assert(m_cursor <= m_len);
+ ASSERT(m_cursor <= m_len);
if (m_input)
m_input->invalidate();
m_cursor++;
- assert(m_cursor <= m_len);
+ ASSERT(m_cursor <= m_len);
if (m_input)
m_input->invalidate();
if (!m_content)
return eWidget::event(event, data, data2);
- assert(m_content);
+ ASSERT(m_content);
getStyle(style);
while (root && !root->m_desktop)
{
root = root->m_parent;
- assert(root);
+ ASSERT(root);
if (root->m_layer != -1)
target_layer = root->m_layer;
abspos += root->position();
probably somebody already erased the root, but tries some
operations on a child window.
ignore them for now. */
- /* assert(root); */
+ /* ASSERT(root); */
return;
}
if (root->m_layer != -1)
return;
abspos += root->position();
}
- assert(root->m_desktop);
+ ASSERT(root->m_desktop);
gRegion abs = m_visible_with_childs;
abs.moveBy(abspos);
while (root && !root->m_desktop)
{
root = root->m_parent;
- assert(root);
+ ASSERT(root);
abspos += root->position();
}
break;
}
t = t->m_parent;
- assert(t);
+ ASSERT(t);
} while(1);
}
void eWidgetDesktop::addRootWidget(eWidget *root)
{
- assert(!root->m_desktop);
+ ASSERT(!root->m_desktop);
int invert_sense = 0;
/* buffered mode paints back-to-front, while immediate mode is front-to-back. */
ePtr<gPixmap> target_pixmap;
m_screen.m_dc->getPixmap(target_pixmap);
- assert(target_pixmap);
+ ASSERT(target_pixmap);
if (target_pixmap->surface && target_pixmap->surface->bpp > 8)
return;
if (m_comp_mode != cmBuffered)
return;
- assert(m_screen.m_dc);
+ ASSERT(m_screen.m_dc);
gPainter p(m_screen.m_dc);
p.resetClip(eRect(ePoint(0, 0), m_screen.m_screen_size));
{
stopService();
- assert(m_servicehandler);
+ ASSERT(m_servicehandler);
RESULT res = m_servicehandler->play(service, m_runningService);
if (m_runningService)
{
RESULT eNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service, bool simulate)
{
- assert(m_servicehandler);
+ ASSERT(m_servicehandler);
RESULT res = m_servicehandler->record(ref, service);
eDebug("record: %d", res);
if (res)
eNavigation::eNavigation(iServiceHandler *serviceHandler)
{
- assert(serviceHandler);
+ ASSERT(serviceHandler);
m_servicehandler = serviceHandler;
}
ePtr<iServiceHandler> service_center;
eServiceCenter::getInstance(service_center);
- assert(service_center);
+ ASSERT(service_center);
m_core = new eNavigation(service_center);
m_core->connectEvent(slot(*this, &pNavigation::navEvent), m_nav_event_connection);
RESULT eServiceDVD::start()
{
- assert(m_state == stIdle);
+ ASSERT(m_state == stIdle);
m_state = stRunning;
eDebug("eServiceDVD starting");
// m_event(this, evStart);
RESULT eServiceDVD::stop()
{
- assert(m_state != stIdle);
+ ASSERT(m_state != stIdle);
if (m_state == stStopped)
return -1;
eDebug("DVD: stop %s", m_filename.c_str());
m_lst=0;
return;
}
- assert(m_service_center);
+ ASSERT(m_service_center);
if (m_service_center->list(m_root, m_lst))
eDebug("no list available!");
RESULT eDVBServicePlay::setSlowMotion(int ratio)
{
- assert(ratio); /* The API changed: instead of calling setSlowMotion(0), call play! */
+ ASSERT(ratio); /* The API changed: instead of calling setSlowMotion(0), call play! */
eDebug("eDVBServicePlay::setSlowMotion(%d)", ratio);
setFastForward_internal(0);
if (m_decoder)
RESULT eDVBServicePlay::setFastForward(int ratio)
{
eDebug("eDVBServicePlay::setFastForward(%d)", ratio);
- assert(ratio);
+ ASSERT(ratio);
return setFastForward_internal(ratio);
}
RESULT eServiceMP3::start()
{
- assert(m_state == stIdle);
+ ASSERT(m_state == stIdle);
m_state = stRunning;
if (m_gst_pipeline)
RESULT eServiceMP3::stop()
{
- assert(m_state != stIdle);
+ ASSERT(m_state != stIdle);
if (m_state == stStopped)
return -1;
eDebug("MP3: %s stop\n", m_filename.c_str());
if (m_state == stError)
return -1;
- assert(m_state == stIdle);
- assert(stream);
+ ASSERT(m_state == stIdle);
+ ASSERT(stream);
if (!xine_open(stream, m_filename.c_str()))
{
if (m_state == stError)
return -1;
- assert(m_state != stIdle);
- assert(stream);
+ ASSERT(m_state != stIdle);
+ ASSERT(stream);
if (m_state == stStopped)
return -1;
printf("Xine: %s stop\n", m_filename.c_str());
pts = -1;
if (m_state == stError)
return 1;
- assert(stream);
+ ASSERT(stream);
int pos_stream, pos_time, length_time;
pts = -1;
if (m_state == stError)
return 1;
- assert(stream);
+ ASSERT(stream);
int pos_stream, pos_time, length_time;