Made BDebugEventInputStream::ReadNextEvent() nicer to use.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30260 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-04-19 11:17:24 +00:00
parent 98b956380c
commit 36e787103f
4 changed files with 51 additions and 30 deletions
+10 -6
View File
@@ -134,15 +134,19 @@ MainModelLoader::_Loader()
try {
while (true) {
// get next event
const system_profiler_event_header* header;
ssize_t bufferSize = fInput->ReadNextEvent(&header);
if (bufferSize < 0) {
success = bufferSize == B_ENTRY_NOT_FOUND;
uint32 event;
uint32 cpu;
const void* buffer;
ssize_t bufferSize = fInput->ReadNextEvent(&event, &cpu, &buffer);
if (bufferSize < 0)
break;
if (buffer == NULL) {
success = true;
break;
}
// process the event
status_t error = _ProcessEvent(header, bufferSize);
status_t error = _ProcessEvent(event, cpu, buffer, bufferSize);
if (error != B_OK)
break;
@@ -178,7 +182,7 @@ MainModelLoader::_Loader()
status_t
MainModelLoader::_ProcessEvent(const system_profiler_event_header* header,
MainModelLoader::_ProcessEvent(uint32 event, uint32 cpu, const void* buffer,
size_t size)
{
// TODO: Implement!