MSC warnings fixed, CtrlLib: .lay UNTYPED now without properties

This commit is contained in:
Mirek Fidler 2022-05-14 08:47:02 +02:00
parent 76cc33f2f1
commit 6a86f2ac03
8 changed files with 42 additions and 37 deletions

View file

@ -193,11 +193,6 @@ subctrl NormalSize {
subctrl Base {
>NormalSize;
Font SetFont = StdFont();
Color SetInk = :SBlack;
Frame SetFrame @1;
// Qtf SetInfo @1 ? "Info of control" ;
ViewRect(w) {
r = GetRect();
DrawCtrlFrame(w, r, .SetFrame);
@ -210,7 +205,17 @@ subctrl Base {
};
subctrl Unknown {
> Base;
>NormalSize;
ViewRect(w) {
r = GetRect();
DrawCtrlFrame(w, r, .SetFrame);
return r;
}
ViewSize(w) {
r = ViewRect(w);
return Size(r.right - r.left, r.bottom - r.top);
}
};
subctrl TextCtrl {

View file

@ -353,7 +353,7 @@ uint64 Image::GetAuxData() const
return data ? data->aux_data : 0;
}
static void sMultiply(ImageBuffer& b, int (*op)(RGBA *t, const RGBA *s, int len))
static void sMultiply(ImageBuffer& b, int (*op)(RGBA *t, const RGBA *s, size_t len))
{
if(b.GetKind() != IMAGE_OPAQUE && b.GetKind() != IMAGE_EMPTY)
(*op)(~b, ~b, b.GetLength());
@ -369,7 +369,7 @@ void Unmultiply(ImageBuffer& b)
sMultiply(b, Unmultiply);
}
static Image sMultiply(const Image& img, int (*op)(RGBA *t, const RGBA *s, int len))
static Image sMultiply(const Image& img, int (*op)(RGBA *t, const RGBA *s, size_t len))
{
int k = img.GetKind();
if(k == IMAGE_OPAQUE || k == IMAGE_EMPTY)

View file

@ -8,11 +8,11 @@ enum ImageKind {
IMAGE_OPAQUE,
};
inline void Fill(RGBA *t, RGBA c, int n) { memset32(t, *(dword *)&c, n); }
inline void Fill(RGBA *t, RGBA c, size_t n) { memset32(t, *(dword *)&c, n); }
inline void Copy(RGBA *t, const RGBA *s, int n) { memcpy_t(t, s, n); }
int Premultiply(RGBA *t, const RGBA *s, int len);
int Unmultiply(RGBA *t, const RGBA *s, int len);
int Premultiply(RGBA *t, const RGBA *s, size_t len);
int Unmultiply(RGBA *t, const RGBA *s, size_t len);
void TransformComponents(RGBA *t, const RGBA *s, int len,
const byte r[], const byte g[], const byte b[], const byte a[]);
@ -167,26 +167,26 @@ private:
void SetAuxData(uint64 data);
public:
Size GetSize() const { return data ? data->buffer.GetSize() : Size(0, 0); }
int GetWidth() const { return GetSize().cx; }
int GetHeight() const { return GetSize().cy; }
int GetLength() const { return data ? data->buffer.GetLength() : 0; }
Point GetHotSpot() const;
Point Get2ndSpot() const;
Size GetDots() const;
Size GetDPI() const;
int GetKindNoScan() const;
int GetKind() const;
int GetResolution() const;
bool IsOpaque() const { return GetKind() == IMAGE_OPAQUE; }
Size GetSize() const { return data ? data->buffer.GetSize() : Size(0, 0); }
int GetWidth() const { return GetSize().cx; }
int GetHeight() const { return GetSize().cy; }
size_t GetLength() const { return data ? data->buffer.GetLength() : 0; }
Point GetHotSpot() const;
Point Get2ndSpot() const;
Size GetDots() const;
Size GetDPI() const;
int GetKindNoScan() const;
int GetKind() const;
int GetResolution() const;
bool IsOpaque() const { return GetKind() == IMAGE_OPAQUE; }
const RGBA *Begin() const { return data ? ~data->buffer : NULL; }
const RGBA *begin() const { return Begin(); }
const RGBA *End() const { return Begin() + GetLength(); }
const RGBA *end() const { return End(); }
const RGBA* operator~() const { return Begin(); }
operator const RGBA*() const { return Begin(); }
const RGBA* operator[](int i) const { ASSERT(data); return data->buffer[i]; }
const RGBA *Begin() const { return data ? ~data->buffer : NULL; }
const RGBA *begin() const { return Begin(); }
const RGBA *End() const { return Begin() + GetLength(); }
const RGBA *end() const { return End(); }
const RGBA* operator~() const { return Begin(); }
operator const RGBA*() const { return Begin(); }
const RGBA* operator[](int i) const { ASSERT(data); return data->buffer[i]; }
int64 GetSerialId() const { return data ? data->serial : 0; }
bool IsSame(const Image& img) const { return GetSerialId() == img.GetSerialId(); }

View file

@ -82,7 +82,7 @@ String PackRLE(const RGBA *s, int len)
return String(r);
}
int Premultiply(RGBA *t, const RGBA *s, int len)
int Premultiply(RGBA *t, const RGBA *s, size_t len)
{
const RGBA *e = s + len;
while(s < e) {
@ -125,7 +125,7 @@ void sInitUmTable__()
}
}
int Unmultiply(RGBA *t, const RGBA *s, int len)
int Unmultiply(RGBA *t, const RGBA *s, size_t len)
{
sInitUmTable__();
const RGBA *e = s + len;

View file

@ -347,7 +347,7 @@ Image Equalight(const Image& img, int thold)
histogram[Grayscale(*s)]++;
s++;
}
int n = (thold * img.GetLength()) >> 8;
size_t n = (thold * img.GetLength()) >> 8;
int h = 255;
int l = 0;
while(l < h) {

View file

@ -17,7 +17,7 @@ Vector<ImageIml> UnpackImlData(const void *ptr, int len)
ib.SetHotSpot(Point(Peek16le(s + 5), Peek16le(s + 7)));
ib.Set2ndSpot(Point(Peek16le(s + 9), Peek16le(s + 11)));
s += 13;
int len = ib.GetLength();
size_t len = ib.GetLength();
RGBA *t = ib;
const RGBA *e = t + len;
if(s + 4 * len > data.End())

View file

@ -21,7 +21,7 @@ struct scImageMaker : ValueMaker {
if(paintonly && !IsNull(img) && img.GetRefCount() == 1)
SetPaintOnly__(img);
object = img;
return img.GetLength() + 64;
return (int)min((size_t) INT_MAX, img.GetLength()) + 64;
}
};
@ -36,7 +36,7 @@ void SysImageRealized(const Image& img)
ValueCacheAdjustSize([](const Value& v) -> int {
if(v.Is<Image>()) {
const Image& img = v.To<Image>();
return 64 + (~img ? img.GetLength() : 0);
return 64 + (~img ? (int)min((size_t) INT_MAX, img.GetLength()) : 0);
}
return -1;
});

View file

@ -272,7 +272,7 @@ CONSOLE_APP_MAIN
for(const String& s : runargs)
Add(s);
args.Add(NULL);
SetExitCode(execv(ide.target, args.begin()));
SetExitCode((int)execv(ide.target, args.begin()));
}
}
else