From 644780047090442429342addb3fa97ec95bdc670 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 24 Jan 2007 23:31:45 +0000 Subject: There was quite a bit of deadwood in this file. I am removing it to make the file more readable (and smaller overall). --- (limited to 'noncore') diff --git a/noncore/apps/opie-reader/Reb.cpp b/noncore/apps/opie-reader/Reb.cpp index 2e6c1fc..65de9f6 100644 --- a/noncore/apps/opie-reader/Reb.cpp +++ b/noncore/apps/opie-reader/Reb.cpp @@ -6,52 +6,6 @@ #include "my_list.h" #include "Bkmks.h" #include "Model.h" -/* -#ifdef offsetof -#define OffsetOf(type, field) ((int) offsetof(type, field)) -#else -#define OffsetOf(type, field) ((int) ((char *) &((type *) 0)->field)) -#endif - -template -UInt32 binarychop(T* data, UInt32 n, T val) -{ - UInt32 jl = 0,jh = n-1,jm = (jl+jh)/2; - while (jh > jl+1) - { - if (data[jm] > val) - { - jh = jm; - } - else - { - jl = jm; - } - jm = (jl+jh)/2; - } - return jl; -} - -template -UInt32 binarychop(D* data, UInt32 n, T val, UInt32 offset) -{ - UInt32 jl = 0,jh = n-1,jm = (jl+jh)/2; - while (jh > jl+1) - { - T* d = reinterpret_cast(reinterpret_cast(data+jm)+offset); - if (*d > val) - { - jh = jm; - } - else - { - jl = jm; - } - jm = (jl+jh)/2; - } - return jl; -} -*/ CReb::CReb() : @@ -77,20 +31,6 @@ unsigned int CReb::locate() void CReb::locate(unsigned int n) { - /* - UInt32 cp = nopages-1; - for (int i = 0; i < nopages; ++i) - { - if (m_pagedetails[i].pagestart > n) - { - cp = i-1; - break; - } - } - qDebug("Requesting %u from page %u [%u]", n, cp, n - m_pagedetails[cp].pagestart); - */ - //UInt32 jl = binarychop(m_pagedetails, nopages, n, OffsetOf(Page_detail, pagestart)); - UInt32 jl = 0,jh = nopages-1,jm = (jl+jh)/2; while (jh > jl+1) { @@ -112,8 +52,6 @@ void CReb::locate(unsigned int n) currentpage.setoffset(page2pos(jl), jl, ((rs.flags & 8) != 0), rs.len, val); if (noparas > 0) { - //jl = binarychop(paras, noparas, val, OffsetOf(ParaRef, pos)); - UInt32 jl = 0,jh = noparas-1,jm = (jl+jh)/2; while (jh > jl+1) { @@ -758,8 +696,6 @@ void CReb::start2endSection() { if (nojoins > 0) { - //UInt32 jl = binarychop(joins, nojoins, currentpage.offset()); - UInt32 jl = 0,jh = nojoins-1,jm = (jl+jh)/2; while (jh > jl+1) { @@ -776,7 +712,6 @@ void CReb::start2endSection() currentpage.m_startoff = joins[jl]; currentpage.m_endoff = joins[jl+1]-1; - //currentpage.m_endoff = joins[jh]-1; } m_currentstart = m_pagedetails[currentpage.pageno()].pagestart+currentpage.m_startoff; m_currentend = m_pagedetails[currentpage.pageno()].pagestart+currentpage.m_endoff; -- cgit v0.9.0.2