]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/graphic.cpp
Use size_t to represent counts and indices
[libs/gltk.git] / source / graphic.cpp
index 095e19441be082aed682be2f4b6a928229cbe7fb..fb3f8893d2460112b88d0b71a6ce6c9790c92b61 100644 (file)
@@ -16,18 +16,18 @@ void Graphic::build(unsigned wd, unsigned ht, GL::PrimitiveBuilder &bld) const
        create_texcoords(slice.x, slice.x+slice.w, border.left, border.right, texture->get_width(), u);
        create_texcoords(slice.y, slice.y+slice.h, border.bottom, border.top, texture->get_height(), v);
 
-       unsigned xmin = border.left ? 0 : 1;
-       unsigned xmax = x.size()-(border.right ? 2 : 3);
-       unsigned ymin = border.bottom ? 0 : 1;
-       unsigned ymax = y.size()-(border.top ? 2 : 3);
+       size_t xmin = border.left ? 0 : 1;
+       size_t xmax = x.size()-(border.right ? 2 : 3);
+       size_t ymin = border.bottom ? 0 : 1;
+       size_t ymax = y.size()-(border.top ? 2 : 3);
 
        bld.color(1.0f, 1.0f, 1.0f);
-       for(unsigned i=ymin; i<=ymax; ++i)
+       for(size_t i=ymin; i<=ymax; ++i)
        {
-               unsigned i2 = (i==0 ? 0 : i==y.size()-2 ? 2 : 1);
-               for(unsigned j=xmin; j<=xmax; ++j)
+               size_t i2 = (i==0 ? 0 : i==y.size()-2 ? 2 : 1);
+               for(size_t j=xmin; j<=xmax; ++j)
                {
-                       unsigned j2 = (j==0 ? 0 : j==x.size()-2 ? 2 : 1);
+                       size_t j2 = (j==0 ? 0 : j==x.size()-2 ? 2 : 1);
                        if(j==xmin || (j>1 && j<x.size()-2))
                        {
                                if(j>xmin)