mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
*uppsrc: Fixed many GCC warnings
git-svn-id: svn://ultimatepp.org/upp/trunk@4457 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5de4dcba84
commit
d5291b7d48
54 changed files with 6963 additions and 6971 deletions
|
|
@ -453,7 +453,7 @@ void CodeEditor::HighlightLine(int line, Vector<LineEdit::Highlight>& hl, int po
|
|||
const wchar *p = text;
|
||||
const wchar *e = text.End();
|
||||
int uvsn;
|
||||
Color c = GetUvsHighlight(text, uvsn);
|
||||
GetUvsHighlight(text, uvsn);
|
||||
if(uvsn) {
|
||||
hls.SetInk(0, text.GetLength() + 1, Yellow);
|
||||
hls.SetPaper(0, text.GetLength() + 1, Gray);
|
||||
|
|
|
|||
|
|
@ -402,7 +402,9 @@ void LaunchWebBrowser(const String& url)
|
|||
};
|
||||
for(int i = 0; i < __countof(browser); i++)
|
||||
if(system("which " + String(browser[i])) == 0) {
|
||||
system(String(browser[i]) + " " + url + " &");
|
||||
IGNORE_RESULT(
|
||||
system(String(browser[i]) + " " + url + " &")
|
||||
);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ NAMESPACE_UPP
|
|||
#define LLOGHEXDUMP(x, s) // LOGHEXDUMP(x, s)
|
||||
|
||||
void BlockStream::SetBufferSize(dword size) {
|
||||
int64 p;
|
||||
int64 p = 0;
|
||||
if(IsOpen()) {
|
||||
p = GetPos();
|
||||
Flush();
|
||||
|
|
@ -409,7 +409,7 @@ void FileStream::SetStreamSize(int64 pos)
|
|||
while(pos > len) {
|
||||
static char buffer[1024];
|
||||
int64 diff = pos - len;
|
||||
int chunk = (diff > sizeof(buffer) ? sizeof(buffer) : (int)diff);
|
||||
int chunk = (diff > (int64)sizeof(buffer) ? sizeof(buffer) : (int)diff);
|
||||
if(write(handle, buffer, chunk) != chunk) {
|
||||
SetLastError();
|
||||
LSEEK64_(handle, cur, SEEK_SET);
|
||||
|
|
|
|||
|
|
@ -600,3 +600,6 @@ void __LOGF__(const char *format, ...);
|
|||
#else
|
||||
inline void __LOGF__(const char *format, ...);
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
void IGNORE_RESULT(const T&) {}
|
||||
|
|
|
|||
|
|
@ -390,7 +390,9 @@ void LocalProcess::Write(String s)
|
|||
WriteFile(hInputWrite, s, s.GetLength(), &n, NULL);
|
||||
#endif
|
||||
#ifdef PLATFORM_POSIX
|
||||
write(rpipe[1], s, s.GetLength());
|
||||
IGNORE_RESULT(
|
||||
write(rpipe[1], s, s.GetLength())
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,12 +155,18 @@ void LogStream::Create(const char *path, bool append)
|
|||
}
|
||||
WriteFile(hfile, "\r\n", 2, &n, NULL);
|
||||
#else
|
||||
write(hfile, h, strlen(h));
|
||||
IGNORE_RESULT(
|
||||
write(hfile, h, strlen(h))
|
||||
);
|
||||
if(part) {
|
||||
sprintf(h, ", #%d", part);
|
||||
write(hfile, h, strlen(h));
|
||||
IGNORE_RESULT(
|
||||
write(hfile, h, strlen(h))
|
||||
);
|
||||
}
|
||||
write(hfile, "\r\n", 2);
|
||||
IGNORE_RESULT(
|
||||
write(hfile, "\r\n", 2)
|
||||
);
|
||||
#endif
|
||||
bol = true;
|
||||
}
|
||||
|
|
@ -186,7 +192,9 @@ void LogStream::Flush()
|
|||
#else
|
||||
if(options & LOG_FILE)
|
||||
if(hfile >= 0)
|
||||
write(hfile, buffer, count);
|
||||
IGNORE_RESULT(
|
||||
write(hfile, buffer, count)
|
||||
);
|
||||
if(options & LOG_DBG)
|
||||
Cerr().Put(buffer, count);
|
||||
#endif
|
||||
|
|
@ -252,6 +260,7 @@ bool LogStream::IsOpen() const
|
|||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
static void sLarge(String& text, size_t *large, int count, const char *txt)
|
||||
{
|
||||
int n = min(1024, count);
|
||||
|
|
@ -268,6 +277,7 @@ static void sLarge(String& text, size_t *large, int count, const char *txt)
|
|||
text << Format("%4d`KB, %5d %s (%6d KB)\r\n", (int)(uintptr_t)(q >> 10), nn, txt, (int)(uintptr_t)((nn * q) >> 10));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
String AsString(const MemoryProfile& mem)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -202,8 +202,7 @@ String GetCurrentDirectory() {
|
|||
}
|
||||
#elif defined(PLATFORM_POSIX)
|
||||
char h[1024];
|
||||
getcwd(h, 1024);
|
||||
return FromSystemCharset(h);
|
||||
return getcwd(h, 1024) ? FromSystemCharset(h) : String();
|
||||
#else
|
||||
#error GetCurrentDirectory not implemented for this platform, comment this line to get Null
|
||||
return Null;
|
||||
|
|
@ -212,9 +211,9 @@ String GetCurrentDirectory() {
|
|||
#endif
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
void SetCurrentDirectory(const char *path)
|
||||
bool SetCurrentDirectory(const char *path)
|
||||
{
|
||||
chdir(path);
|
||||
return chdir(path) == 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -724,23 +723,16 @@ String NormalizePath(const char *path, const char *currdir) {
|
|||
out = (sDirSep(currdir[0]) && sDirSep(currdir[1]) ? "//" : "/");
|
||||
p = Split(currdir, CharFilterTextTest(sDirSep));
|
||||
}
|
||||
bool quote = false;
|
||||
for(; i < si.GetCount(); i++) {
|
||||
String s = si[i];
|
||||
if(s != "." && !s.IsEmpty())
|
||||
if(s[0] == '.' && s[1] == '.') {
|
||||
if(!p.IsEmpty()) p.Drop();
|
||||
}
|
||||
else {
|
||||
else
|
||||
p.Add(s);
|
||||
if(s.Find(' ') >= 0)
|
||||
quote = true;
|
||||
}
|
||||
}
|
||||
out.Cat(Join(p, DIR_SEPS));
|
||||
// if(quote)
|
||||
// return '\"' + out + '\"';
|
||||
// else
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -1052,7 +1044,6 @@ String GetSymLinkPath(const char *linkpath)
|
|||
return path;
|
||||
#else
|
||||
char buff[_MAX_PATH + 1];
|
||||
bool ret;
|
||||
int len = readlink(linkpath, buff, _MAX_PATH);
|
||||
if(len > 0 && len < _MAX_PATH)
|
||||
return String(buff, len);
|
||||
|
|
|
|||
|
|
@ -161,8 +161,12 @@ MTrand::MTrand()
|
|||
dword seed[1024];
|
||||
#ifdef PLATFORM_POSIX
|
||||
int fd = open("/dev/urandom", O_RDONLY);
|
||||
read(fd, seed, sizeof(seed));
|
||||
if(fd != -1) {
|
||||
IGNORE_RESULT(
|
||||
read(fd, seed, sizeof(seed))
|
||||
);
|
||||
close(fd);
|
||||
}
|
||||
#else
|
||||
for(int i = 0; i < 1024; i++) {
|
||||
Uuid uuid;
|
||||
|
|
|
|||
|
|
@ -758,6 +758,11 @@ Stream& Stream::operator/(WString& s) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
Stream& Stream::operator/(int& i) { dword w = 0; if(IsStoring()) w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
Stream& Stream::operator/(unsigned int& i) { dword w = 0; if(IsStoring()) w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
Stream& Stream::operator/(long& i) { dword w = 0; if(IsStoring()) w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
Stream& Stream::operator/(unsigned long& i) { dword w = 0; if(IsStoring()) w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
|
||||
void Stream::Magic(dword magic) {
|
||||
dword a = magic;
|
||||
*this % a;
|
||||
|
|
|
|||
|
|
@ -212,10 +212,10 @@ public:
|
|||
Stream& operator/(WString& s);
|
||||
|
||||
void Pack(dword& i);
|
||||
Stream& operator/(int& i) { dword w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
Stream& operator/(unsigned int& i) { dword w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
Stream& operator/(long& i) { dword w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
Stream& operator/(unsigned long& i) { dword w = i + 1; Pack(w); i = w - 1; return *this; }
|
||||
Stream& operator/(int& i);
|
||||
Stream& operator/(unsigned int& i);
|
||||
Stream& operator/(long& i);
|
||||
Stream& operator/(unsigned long& i);
|
||||
|
||||
void Magic(dword magic = 0x7d674d7b);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,12 @@ void PanicMessageBox(const char *title, const char *text)
|
|||
if(sPanicMessageBox)
|
||||
(*sPanicMessageBox)(title, text);
|
||||
else {
|
||||
write(2, text, (int)strlen(text));
|
||||
write(2, "\n", 1);
|
||||
IGNORE_RESULT(
|
||||
write(2, text, (int)strlen(text))
|
||||
);
|
||||
IGNORE_RESULT(
|
||||
write(2, "\n", 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -888,7 +892,9 @@ static void LinuxBeep(const char *fn)
|
|||
#else
|
||||
if(fork()) return;
|
||||
#endif
|
||||
system(h);
|
||||
IGNORE_RESULT(
|
||||
system(h)
|
||||
);
|
||||
_exit(EXIT_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ Image MakeDragImage(const Image& arrow, Image sample)
|
|||
else {
|
||||
b.Create(128, 128);
|
||||
memset(~b, 0, sizeof(RGBA) * b.GetLength());
|
||||
Size ssz = sample.GetSize();
|
||||
Over(b, Point(2, 22), sample, sample.GetSize());
|
||||
Unmultiply(b);
|
||||
for(int y = 20; y < 96; y++) {
|
||||
|
|
|
|||
|
|
@ -233,7 +233,6 @@ Ctrl *Ctrl::ChildFromPoint(Point& pt) const
|
|||
GuiLock __;
|
||||
Ctrl *q;
|
||||
Point p = pt;
|
||||
Rect rect = GetRect();
|
||||
Rect view = GetView();
|
||||
if(view.Contains(p)) {
|
||||
Point vp = p - view.TopLeft();
|
||||
|
|
@ -600,7 +599,6 @@ Ctrl *Ctrl::GetVisibleChild(Ctrl *ctrl, Point p, bool pointinframe)
|
|||
if(!pointinframe)
|
||||
p += ctrl->GetView().TopLeft();
|
||||
Ctrl *q;
|
||||
Rect rect = ctrl->GetRect();
|
||||
Rect view = ctrl->GetView();
|
||||
if(view.Contains(p)) {
|
||||
p -= view.TopLeft();
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ void InitX11Draw(XDisplay *display)
|
|||
for(int g = 0; g < 24; g++)
|
||||
for(int b = 0; b < 12; b++) {
|
||||
int mind = INT_MAX;
|
||||
int mini;
|
||||
int mini = 0;
|
||||
for(int i = 0; i < colorcount; i++) {
|
||||
int d = ssq(r * 255 / 11 - (cs[i].red >> 8)) +
|
||||
ssq(g * 255 / 23 - (cs[i].green >> 8)) +
|
||||
|
|
|
|||
|
|
@ -183,19 +183,19 @@ private:
|
|||
RichText ParseRTF(const char *rtf) { return RTFParser(rtf).Run(); }
|
||||
|
||||
RTFParser::CellInfo::CellInfo()
|
||||
: end_dots(0)
|
||||
, cellmarginunits(0, 0, 0, 0)
|
||||
: cellmarginunits(0, 0, 0, 0)
|
||||
, shading(0)
|
||||
, shading_fore(Black())
|
||||
, shading_back(White())
|
||||
, end_dots(0)
|
||||
{
|
||||
}
|
||||
|
||||
RTFParser::Cell::Cell()
|
||||
: nbegin(0)
|
||||
, span(0, 0)
|
||||
, merge_first(false)
|
||||
: merge_first(false)
|
||||
, merge(false)
|
||||
, nbegin(0)
|
||||
, span(0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +250,6 @@ void RTFParser::FlushTable(int level)
|
|||
dot_index.Add(child.tableformat.lm);
|
||||
for(int r = 0; r < child.cells.GetCount(); r++) {
|
||||
Array<Cell>& rw = child.cells[r];
|
||||
int pos = child.tableformat.lm;
|
||||
for(int c = 0; c < rw.GetCount(); c++)
|
||||
dot_index.FindAdd(rw[c].info.end_dots);
|
||||
}
|
||||
|
|
@ -355,7 +354,7 @@ void RTFParser::FlushTable(int level)
|
|||
};
|
||||
for(int b = 0; b < __countof(border_width); b++) {
|
||||
int tbl_wd = (outer_border[b] ? tbl_border : tbl_grid);
|
||||
Color tbl_co = (outer_border[b] ? clr_border : clr_grid);
|
||||
// Color tbl_co = (outer_border[b] ? clr_border : clr_grid);
|
||||
if(*border_width[b] <= tbl_wd)
|
||||
*border_width[b] = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,13 +64,13 @@ void TopWindow::EventProc(XWindow& w, XEvent *event)
|
|||
if(event->type == PropertyNotify && event->xproperty.atom == XAtom("_NET_WM_STATE")) {
|
||||
LLOG("_NET_WM_STATE notify");
|
||||
Vector<int> p = GetPropertyInts(GetWindow(), XAtom("_NET_WM_STATE"));
|
||||
if(FindIndex(p, XAtom("_NET_WM_STATE_HIDDEN")) >= 0) {
|
||||
if(FindIndex(p, (int)XAtom("_NET_WM_STATE_HIDDEN")) >= 0) {
|
||||
state = MINIMIZED;
|
||||
LLOG("MINIMIZED");
|
||||
}
|
||||
else
|
||||
if(FindIndex(p, XAtom("_NET_WM_STATE_MAXIMIZED_HORZ")) >= 0 &&
|
||||
FindIndex(p, XAtom("_NET_WM_STATE_MAXIMIZED_VERT")) >= 0) {
|
||||
if(FindIndex(p, (int)XAtom("_NET_WM_STATE_MAXIMIZED_HORZ")) >= 0 &&
|
||||
FindIndex(p, (int)XAtom("_NET_WM_STATE_MAXIMIZED_VERT")) >= 0) {
|
||||
state = MAXIMIZED;
|
||||
LLOG("MAXIMIZED");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,8 +155,12 @@ void Ctrl::UntrapX11Errors(bool b)
|
|||
|
||||
void sPanicMessageBox(const char *title, const char *text)
|
||||
{
|
||||
write(2, text, strlen(text));
|
||||
write(2, "\n", 1);
|
||||
IGNORE_RESULT(
|
||||
write(2, text, strlen(text))
|
||||
);
|
||||
IGNORE_RESULT(
|
||||
write(2, "\n", 1)
|
||||
);
|
||||
if(Ctrl::grabWindow) {
|
||||
LLOG("RELEASE GRAB");
|
||||
XUngrabPointer(Xdisplay, CurrentTime);
|
||||
|
|
|
|||
|
|
@ -385,11 +385,12 @@ XVisualInfo DHCtrl::GetVisualInfo(void)
|
|||
return *UserVisualInfo;
|
||||
|
||||
XVisualInfo visualInfo;
|
||||
memset(&visualInfo, 0, sizeof(visualInfo));
|
||||
|
||||
// get the active visual
|
||||
Visual *visual = GetVisual();
|
||||
|
||||
// gets a list of all available XVsualinfo
|
||||
// gets a list of all available XVisualinfo
|
||||
XVisualInfo *v = 0;
|
||||
XVisualInfo vtemplate;
|
||||
int nVis;
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ void Ctrl::EventLoop0(Ctrl *ctrl)
|
|||
LoopLevel++;
|
||||
int64 loopno = ++EventLoopNo;
|
||||
LLOG("Entering event loop at level " << LoopLevel << LOG_BEGIN);
|
||||
Ctrl *ploop;
|
||||
Ctrl *ploop = NULL;
|
||||
if(ctrl) {
|
||||
ploop = LoopCtrl;
|
||||
LoopCtrl = ctrl;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ Image GetGTK(GtkWidget *widget, int state, int shadow, const char *detail, int t
|
|||
Rect rect)
|
||||
{
|
||||
MemoryIgnoreLeaksBlock __;
|
||||
GdkPixbuf *icon;
|
||||
GdkPixbuf *icon = NULL;
|
||||
if(type == GTK_ICON || type == GTK_THEMEICON) {
|
||||
gtk_widget_set_sensitive(widget, 1);
|
||||
gtk_widget_set_state(widget, GTK_STATE_NORMAL);
|
||||
|
|
|
|||
|
|
@ -1437,7 +1437,6 @@ void FlatSpin::SetCallbacks(const Callback &cbl, const Callback& cbr)
|
|||
|
||||
void FlatSpin::Layout()
|
||||
{
|
||||
Size sz = GetSize();
|
||||
left.LeftPos(0, left.GetImage().GetSize().cx + 8).VSizePos();
|
||||
right.RightPos(0, right.GetImage().GetSize().cx + 8).VSizePos();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,7 +343,6 @@ int WheelRampCtrl::LevelToClient(int l) const
|
|||
void WheelRampCtrl::Paint(Draw& draw)
|
||||
{
|
||||
if(!cache || cache.GetSize() != wheel_rect.GetSize() || cache_level != (ramp ? h16 : v16)) {
|
||||
Size size = max(GetSize(), Size(1, 1));
|
||||
cache = ramp ? PaintRamp(wheel_rect.GetSize()) : PaintWheel(wheel_rect.GetSize());
|
||||
cache_level = (ramp ? h16 : v16);
|
||||
}
|
||||
|
|
@ -469,7 +468,6 @@ enum { PREC = 64 };
|
|||
Image WheelRampCtrl::PaintRamp(Size size)
|
||||
{
|
||||
ImageDraw iw(size);
|
||||
Size rcsize = wheel_rect.Size();
|
||||
ImageBuffer ib(PREC, PREC);
|
||||
for(int y = 0; y < PREC; y++) {
|
||||
RGBA *scan = ib[y];
|
||||
|
|
|
|||
|
|
@ -381,7 +381,6 @@ Rect EditField::GetCaretRect(int pos) const
|
|||
|
||||
void EditField::SyncCaret()
|
||||
{
|
||||
FontInfo fi = font.Info();
|
||||
Rect r = GetCaretRect(cursor);
|
||||
SetCaret(r.left, r.top, r.GetWidth(), r.GetHeight());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ DisplayPopup::DisplayPopup()
|
|||
ONCELOCK {
|
||||
InstallStateHook(StateHook);
|
||||
}
|
||||
LinkBefore(all);
|
||||
LinkBefore(all());
|
||||
}
|
||||
|
||||
DisplayPopup::~DisplayPopup()
|
||||
|
|
@ -526,7 +526,7 @@ void DisplayPopup::Sync()
|
|||
if(sz.cx + 2 * margin > item.GetWidth() || sz.cy > item.GetHeight()) {
|
||||
slim = item + ctrl->GetScreenView().TopLeft();
|
||||
if(slim.Contains(GetMousePos())) {
|
||||
Rect wa = GetWorkArea();
|
||||
// Rect wa = GetWorkArea();
|
||||
Rect r = item;
|
||||
r.right = max(r.right, r.left + sz.cx + 2 * margin);
|
||||
r.bottom = max(r.bottom, r.top + sz.cy);
|
||||
|
|
@ -545,12 +545,16 @@ void DisplayPopup::Sync()
|
|||
Close();
|
||||
}
|
||||
|
||||
Link<DisplayPopup> DisplayPopup::all[1];
|
||||
Link<DisplayPopup> *DisplayPopup::all()
|
||||
{
|
||||
static Link<DisplayPopup> all;
|
||||
return &all;
|
||||
}
|
||||
|
||||
bool DisplayPopup::StateHook(Ctrl *, int reason)
|
||||
{
|
||||
if(reason == FOCUS)
|
||||
for(DisplayPopup *p = all->Link<DisplayPopup>::GetNext(); p != all; p = p->Link<DisplayPopup>::GetNext())
|
||||
for(DisplayPopup *p = all()->Link<DisplayPopup>::GetNext(); p != all(); p = p->Link<DisplayPopup>::GetNext())
|
||||
p->Sync();
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ private:
|
|||
Point Op(Point p);
|
||||
void Sync();
|
||||
|
||||
static Link<DisplayPopup> all[1];
|
||||
static Link<DisplayPopup> *all();
|
||||
static bool StateHook(Ctrl *, int reason);
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -35,11 +35,6 @@ void RichTextView::Paint(Draw& w)
|
|||
pi.usecache = true;
|
||||
pi.sizetracking = sizetracking;
|
||||
pi.shrink_oversized_objects = shrink_oversized_objects;
|
||||
int y = 0;
|
||||
if(vcenter && sb.GetTotal() < sb.GetPage()) {
|
||||
PageY py = text.GetHeight(GetPage());
|
||||
y = (sz.cy / zoom - py.y) / 2;
|
||||
}
|
||||
Color c = SColorPaper();
|
||||
if(Grayscale(c) < 100)
|
||||
pi.coloroverride = true;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,6 @@ void TabCtrl::Layout()
|
|||
for(int i = 0; i < tab.GetCount(); i++)
|
||||
if(tab[i].ctrl)
|
||||
Ctrl::Add(*tab[i].ctrl);
|
||||
Size sz = GetSize();
|
||||
int th = style->tabheight + style->sel.top;
|
||||
tabs.TopPos(0, th + style->sel.bottom)
|
||||
.HSizePos(0, style->sel.left + style->sel.right);
|
||||
|
|
@ -174,7 +173,6 @@ void TabCtrl::PaintTabs(Draw& w)
|
|||
int th = style->tabheight + tt;
|
||||
Size sz = GetSize();
|
||||
ChPaint(w, 0, th, sz.cx, sz.cy - th, style->body);
|
||||
Size chsz = GetTextSize("M", style->font);
|
||||
for(int phase = 0; phase < 2; phase++) {
|
||||
for(int i = tab.GetCount() - 1; i >= 0; i--)
|
||||
if((sel == i) == phase) {
|
||||
|
|
|
|||
|
|
@ -1037,7 +1037,6 @@ Image TreeCtrl::GetDragSample()
|
|||
Size msz = m.GetSize(display);
|
||||
Size isz = m.image.GetSize();
|
||||
Size vsz = m.GetValueSize(display);
|
||||
Rect r = RectC(0, y, vsz.cx + 2 * m.margin, msz.cy);
|
||||
int x = 0;
|
||||
if(IsSel(l.itemi)) {
|
||||
iw.DrawImage(x, y + (msz.cy - isz.cy) / 2, m.image);
|
||||
|
|
|
|||
|
|
@ -283,8 +283,8 @@ bool Replace(Font fnt, int chr, Font& rfnt)
|
|||
}
|
||||
|
||||
Font f = fnt;
|
||||
dword tl = chr < 4096 ? 0x80000000 >> (chr >> 7) : 0;
|
||||
dword th = 0x80000000 >> ((dword)chr >> 11);
|
||||
// dword tl = chr < 4096 ? 0x80000000 >> (chr >> 7) : 0;
|
||||
// dword th = 0x80000000 >> ((dword)chr >> 11);
|
||||
for(int i = 0; i < rface.GetCount(); i++) {
|
||||
if(/*((l[i] & tl) || (h[i] & th)) && */IsNormal(f.Face(rface[i]), chr)) {
|
||||
int a = fnt.GetAscent();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ bool sInitFt(void)
|
|||
FcPattern *CreateFcPattern(Font font)
|
||||
{
|
||||
LTIMING("CreateXftFont");
|
||||
double sina, cosa;
|
||||
int hg = abs(font.GetHeight());
|
||||
if(hg == 0) hg = 10;
|
||||
String face = font.GetFaceName();
|
||||
|
|
@ -50,7 +49,6 @@ FcPattern *CreateFcPattern(Font font)
|
|||
FT_Face CreateFTFace(const FcPattern *pattern, String *rpath) {
|
||||
FT_Face face = NULL;
|
||||
|
||||
int id;
|
||||
double dsize;
|
||||
double aspect;
|
||||
FcChar8 *filename;
|
||||
|
|
|
|||
|
|
@ -710,7 +710,6 @@ static Pointf Cvp(double x, double y, double sina, double cosa)
|
|||
Image Rotate(const Image& m, int angle)
|
||||
{
|
||||
Size isz = m.GetSize();
|
||||
Point center = isz / 2;
|
||||
Pointf centerf = Pointf(Point(isz)) / 2.0;
|
||||
double sina, cosa;
|
||||
Draw::SinCos(-angle, sina, cosa);
|
||||
|
|
@ -718,9 +717,6 @@ Image Rotate(const Image& m, int angle)
|
|||
Pointf p2 = Cvp(centerf.x, -centerf.y, sina, cosa);
|
||||
Size sz2 = Size(2 * (int)max(tabs(p1.x), tabs(p2.x)),
|
||||
2 * (int)max(tabs(p1.y), tabs(p2.y)));
|
||||
Pointf dcenterf = Sizef(sz2) / 2.0;
|
||||
Point dcenter = sz2 / 2;
|
||||
|
||||
ImageBuffer ib(sz2);
|
||||
Fill(~ib, RGBAZero(), ib.GetLength());
|
||||
RGBA *t = ~ib;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ void RichEdit::Move(int newpos, bool select)
|
|||
void RichEdit::MoveUpDown(int dir, bool select, int pg)
|
||||
{
|
||||
Rect page = pagesz;
|
||||
PageY h = text.GetHeight(pagesz);
|
||||
if(dir > 0 && cursor >= GetLength() && select) {
|
||||
Move(GetLength() + 1, true);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ void RichEdit::SetObjectPos(int pos)
|
|||
Rect rr = r.Offseted(GetTextRect().left, -sb);
|
||||
objectrect = GetObjectRect(pos);
|
||||
objectpos = cursor;
|
||||
PageRect pr = text.GetCaret(cursor, pagesz);
|
||||
PlaceCaret();
|
||||
Refresh(rr);
|
||||
ReadFormat();
|
||||
|
|
@ -185,7 +184,6 @@ void RichEdit::MouseMove(Point p, dword flags)
|
|||
void RichEdit::StdBar(Bar& menu)
|
||||
{
|
||||
int l, h;
|
||||
int fieldpos = -1;
|
||||
Id field;
|
||||
String fieldparam;
|
||||
String ofieldparam;
|
||||
|
|
@ -228,7 +226,6 @@ void RichEdit::StdBar(Bar& menu)
|
|||
bar_fieldparam = p.fieldparam;
|
||||
RichPara::FieldType *ft = RichPara::fieldtype().Get(field, NULL);
|
||||
if(ft) {
|
||||
fieldpos = cursor;
|
||||
ft->Menu(menu, &bar_fieldparam);
|
||||
if(!menu.IsEmpty())
|
||||
menu.Separator();
|
||||
|
|
@ -257,7 +254,6 @@ void RichEdit::RightDown(Point p, dword flags)
|
|||
MenuBar menu;
|
||||
int l, h;
|
||||
Rect ocr = GetCaretRect();
|
||||
int c = GetMousePos(p);
|
||||
int fieldpos = -1;
|
||||
Id field;
|
||||
String ofieldparam;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ void UnitEdit::Spin(int delta)
|
|||
if(IsNull(q))
|
||||
q = 0;
|
||||
else {
|
||||
double h;
|
||||
double h = 10;
|
||||
switch(u) {
|
||||
case UNIT_DOT: h = 10; break;
|
||||
case UNIT_POINT: h = 0.5; break;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _RichEdit_icpp_init_stub
|
||||
#define _RichEdit_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#define BLITZ_INDEX__ F7B84A33358140089DF60DD41168411CA
|
||||
#define BLITZ_INDEX__ F8db56c659ae621fee9530fc849c1b0ec
|
||||
#include "RichEdit.icpp"
|
||||
#undef BLITZ_INDEX__
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ void RichPara::Flush(Draw& draw, const PaintInfo& pi, wchar *text,
|
|||
draw.DrawRect(zx0, zy0, width, 2, pi.indexentry);
|
||||
Font fnt = f;
|
||||
int zht = z * tabs(f.GetHeight());
|
||||
int ssa;
|
||||
int ssd;
|
||||
int ssa = 0;
|
||||
int ssd = 0;
|
||||
if(f.sscript) {
|
||||
FontInfo fi = fnt(zht).Info();
|
||||
ssa = fi.GetAscent();
|
||||
|
|
@ -174,8 +174,8 @@ void RichPara::Paint(PageDraw& pw, const Rect& page, PageY py, const PaintInfo&
|
|||
}
|
||||
opy = py;
|
||||
int oi = 0;
|
||||
int x;
|
||||
int y0;
|
||||
int x = 0;
|
||||
int y0 = 0;
|
||||
int lineascent = 0;
|
||||
for(int lni = 0; lni < pl.GetCount(); lni++) {
|
||||
const Line& li = pl[lni];
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ RichPara::Lines RichPara::FormatLines(int acx) const
|
|||
int cx = lines.first_indent;
|
||||
int rcx = lines.cx - format.lm - format.rm;
|
||||
bool withtabs = false;
|
||||
int scx;
|
||||
int scx = cx;
|
||||
while(s < end) {
|
||||
Tab t;
|
||||
if(*s == ' ') {
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ struct RichHotPos {
|
|||
int left, cx;
|
||||
int textleft, textcx;
|
||||
|
||||
RichHotPos() { table = 0; column = Null; }
|
||||
RichHotPos() { table = 0; column = Null; left = cx = 0; }
|
||||
};
|
||||
|
||||
struct RichValPos : Moveable<RichValPos> {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ void RichTable::Paint(PageDraw& pw, RichContext rc, const PaintInfo& _pi) const
|
|||
pw.tracer->Table(rc.page, rc.py, *this);
|
||||
const TabLayout& tab = Realize(rc);
|
||||
if(!tab.page.IsEmpty()) {
|
||||
Rect p = tab.page;
|
||||
PaintInfo pi = _pi;
|
||||
int frameln = LineZoom(pi.zoom, format.frame);
|
||||
int gridln = LineZoom(pi.zoom, format.grid);
|
||||
|
|
@ -152,7 +151,6 @@ void RichTable::Paint(PageDraw& pw, RichContext rc, const PaintInfo& _pi) const
|
|||
}
|
||||
}
|
||||
for(int i = 0; i < frr.GetCount(); i++) {
|
||||
PaintInfo _pi = pi;
|
||||
pi.tablesel = 0;
|
||||
pi.sell = pi.selh = -1;
|
||||
int pgi = frr.GetKey(i);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ void RichText::Validate()
|
|||
bool RichText::GetInvalid(PageY& top, PageY& bottom, const Rect& page,
|
||||
int sell, int selh, int osell, int oselh) const
|
||||
{
|
||||
int spi;
|
||||
int spi = 0;
|
||||
int rtype = r_type;
|
||||
if(sell != selh || osell != oselh) {
|
||||
if(sell != osell) {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ PageY RichTxt::GetPartPageY(int parti, RichContext rc) const
|
|||
|
||||
bool IsPainting(PageDraw& pw, Zoom z, const Rect& page, PageY top, PageY bottom)
|
||||
{
|
||||
int t = top.y;
|
||||
for(int pi = top.page; pi <= bottom.page; pi++)
|
||||
if(pw.Page(pi).IsPainting(Rect(z * page.left, z * (pi == top.page ? top.y : page.top),
|
||||
z * page.right, z * (pi == bottom.page ? bottom.y : page.bottom))))
|
||||
|
|
|
|||
|
|
@ -889,7 +889,7 @@ void TabBar::PaintTabItems(Tab& t, Draw &w, const Rect& rn, int align)
|
|||
{
|
||||
const TabItem& ti = t.items[i];
|
||||
|
||||
Point p;
|
||||
Point p(0, 0);
|
||||
int pos = ti.side == LEFT ? pos_left : pos_right - ti.size.cx;
|
||||
|
||||
if(!IsNull(ti.img))
|
||||
|
|
|
|||
|
|
@ -441,7 +441,9 @@ void LocalSlaveProcess::Write(String s)
|
|||
WriteFile(hInputWrite, s, s.GetLength(), &n, NULL);
|
||||
#endif
|
||||
#ifdef PLATFORM_POSIX
|
||||
write(rpipe[1], s, s.GetLength());
|
||||
IGNORE_RESULT(
|
||||
write(rpipe[1], s, s.GetLength())
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -512,7 +512,6 @@ void AssistEditor::PopUpAssist(bool auto_insert)
|
|||
Point p = GetCaretPoint() + GetScreenView().TopLeft();
|
||||
Rect wa = GetWorkArea();
|
||||
int cx = min(wa.Width() - 100, HorzLayoutZoom(600));
|
||||
Rect r = RectC(p.x, p.y, cx, cy);
|
||||
if(p.x + cx > wa.right)
|
||||
p.x = wa.right - cx;
|
||||
if(p.y + cy + GetFontSize().cy < wa.bottom)
|
||||
|
|
|
|||
|
|
@ -307,7 +307,6 @@ Blitz CppBuilder::BlitzStep(Vector<String>& sfile, Vector<String>& soptions,
|
|||
Vector<bool>& optimize)
|
||||
{
|
||||
Blitz b;
|
||||
Time now = GetSysTime();
|
||||
Vector<String> excluded;
|
||||
Vector<String> excludedoptions;
|
||||
Vector<bool> excludedoptimize;
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ bool OwcBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
PutConsole("Linking...");
|
||||
bool error = false;
|
||||
CustomStep(".pre-link", Null, error);
|
||||
if (!error, Execute(link) == 0) {
|
||||
if (!error && Execute(link) == 0) {
|
||||
CustomStep(".post-link", Null, error);
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
<< " B) linked in " << GetPrintTime(time));
|
||||
|
|
|
|||
|
|
@ -154,8 +154,12 @@ void ShellOpenFolder(const String& dir)
|
|||
#if defined(PLATFORM_WIN32)
|
||||
LaunchWebBrowser(dir);
|
||||
#elif __APPLE__
|
||||
system("open " + dir + " &");
|
||||
IGNORE_RESULT(
|
||||
system("open " + dir + " &")
|
||||
);
|
||||
#else
|
||||
system("xdg-open " + dir + " &");
|
||||
IGNORE_RESULT(
|
||||
system("xdg-open " + dir + " &")
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ void LocalHost::ChDir(const String& path)
|
|||
SetCurrentDirectory(path);
|
||||
#endif
|
||||
#ifdef PLATFORM_POSIX
|
||||
chdir(path);
|
||||
IGNORE_RESULT( chdir(path) );
|
||||
#endif
|
||||
if(cmdout)
|
||||
*cmdout << "cd \"" << GetHostPath(path) << "\"\n";
|
||||
|
|
|
|||
|
|
@ -185,23 +185,6 @@ static bool RawFileMatch(const char *pattern, const char *file, const char *& en
|
|||
return true;
|
||||
}
|
||||
|
||||
static const char *FindFileMatch(const char *pattern, const char *file, String& cont)
|
||||
{
|
||||
const char *endptr;
|
||||
if(!RawFileMatch(pattern, file, endptr))
|
||||
return endptr;
|
||||
if(cont.IsVoid())
|
||||
{
|
||||
cont = endptr;
|
||||
return NULL;
|
||||
}
|
||||
const char *p = cont;
|
||||
while(*p && ToLower(*p) == ToLower(*endptr++))
|
||||
p++;
|
||||
cont.Trim(int(p - cont.Begin()));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int CharFilterFindFileMask(int c)
|
||||
{
|
||||
return ToUpper(ToAscii(c));
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ void TopicCtrl::SyncDocTree()
|
|||
String hdx = sTopicHome.Mid(1);
|
||||
if(idelink.GetCount() == 0)
|
||||
GatherLinks(idelink, hdx);
|
||||
int ide;
|
||||
int ide = 0;
|
||||
bool idefirst = true;
|
||||
if(MatchTopicLink(hdx, sdx)) {
|
||||
ide = AddTree(0, IdeImg::Package(), "\3" + hdx, s_idehelp);
|
||||
|
|
@ -163,9 +163,9 @@ void TopicCtrl::SyncDocTree()
|
|||
for(int i = 0; i < wspc.GetCount(); i++)
|
||||
used.Add(wspc[i]);
|
||||
|
||||
int usid;
|
||||
int usid = 0;
|
||||
bool usedfirst = true;
|
||||
int otid;
|
||||
int otid = 0;
|
||||
bool otherfirst = true;
|
||||
|
||||
String lng = ~lang;
|
||||
|
|
@ -173,7 +173,7 @@ void TopicCtrl::SyncDocTree()
|
|||
TopicLink tl;
|
||||
tl.package = map.GetKey(i);
|
||||
bool packagefirst = true;
|
||||
int pid;
|
||||
int pid = 0;
|
||||
VectorMap<String, Index<String> >& group = map[i];
|
||||
for(int i = 0; i < group.GetCount(); i++) {
|
||||
tl.group = group.GetKey(i);
|
||||
|
|
@ -185,7 +185,7 @@ void TopicCtrl::SyncDocTree()
|
|||
n = s_documents;
|
||||
if(n == "srcimp")
|
||||
n = s_implementation;
|
||||
int gid;
|
||||
int gid = 0;
|
||||
bool groupfirst = true;
|
||||
const Index<String>& topic = group[i];
|
||||
for(int i = 0; i < topic.GetCount(); i++) {
|
||||
|
|
|
|||
|
|
@ -368,9 +368,9 @@ void EscDraw::DrawSmartText(EscEscape& e)
|
|||
int x = e.Int(0);
|
||||
int y = e.Int(1);
|
||||
int ii = 2;
|
||||
int cx = INT_MAX;
|
||||
if(e[ii].IsInt())
|
||||
cx = e.Int(ii++);
|
||||
// int cx = INT_MAX;
|
||||
// if(e[ii].IsInt())
|
||||
// cx = e.Int(ii++);
|
||||
String text;
|
||||
if(ii < e.GetCount() && e[ii].IsArray())
|
||||
text = ToUtf8((WString)e[ii++]);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ struct NullStep : public ParentCtrl {
|
|||
}
|
||||
};
|
||||
|
||||
static void InitLayout(Upp::Ctrl& parent, NullStep& layout, NullStep& uts, NullStep&){
|
||||
inline
|
||||
void InitLayout(Upp::Ctrl& parent, NullStep& layout, NullStep& uts, NullStep&){
|
||||
parent.LayoutId("NullStepLayout");
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -278,7 +278,6 @@ void WorkspaceWork::TouchFile(const String& path)
|
|||
{
|
||||
if(!showtime)
|
||||
return;
|
||||
Time tm = GetSysTime();
|
||||
String n = GetFileName(path);
|
||||
for(int i = 0; i < filelist.GetCount(); i++) {
|
||||
FileList::File f = filelist[i];
|
||||
|
|
@ -647,12 +646,15 @@ void WorkspaceWork::RemoveFile()
|
|||
int fx = fileindex[i];
|
||||
separator = actual.file[fx].separator;
|
||||
if(separator && closed.Find(GetActiveSepfo()) >= 0) {
|
||||
int px = fx, c;
|
||||
int px = fx;
|
||||
while(--px >= 0 && !actual.file[fx].separator)
|
||||
;
|
||||
if(px >= 0 && (c = closed.Find(Sepfo(GetActivePackage(), actual.file[px]))) >= 0)
|
||||
if(px >= 0) {
|
||||
int c = closed.Find(Sepfo(GetActivePackage(), actual.file[px]));
|
||||
if(c >= 0)
|
||||
closed.Unlink(c);
|
||||
}
|
||||
}
|
||||
actual.file.Remove(fx);
|
||||
}
|
||||
if(separator || IsAux())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue