Removed more unused code. - sam - An updated version of the sam text editor.
(HTM) git clone git://vernunftzentrum.de/sam.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 4630064b766cae44c24fa5e731439c445bd2c058
(DIR) parent 2c4a17e0c7e6362d8fa93722602d2d9484065a12
(HTM) Author: Rob King <jking@deadpixi.com>
Date: Tue, 4 Oct 2016 00:24:53 -0500
Removed more unused code.
Diffstat:
include/libg.h | 2 --
libXg/Makefile | 2 +-
libXg/rdbitmap.c | 63 -------------------------------
3 files changed, 1 insertion(+), 66 deletions(-)
---
(DIR) diff --git a/include/libg.h b/include/libg.h
@@ -184,9 +184,7 @@ extern Point strsize(XftFont*, char*);
extern int64_t charwidth(XftFont*, wchar_t);
extern void texture(Bitmap*, Rectangle, Bitmap*, Fcode);
extern void wrbitmap(Bitmap*, int, int, unsigned char*);
-extern void rdbitmap(Bitmap*, int, int, unsigned char*);
extern void wrbitmapfile(int, Bitmap*);
-extern Bitmap* rdbitmapfile(int);
extern int ptinrect(Point, Rectangle);
extern int rectXrect(Rectangle, Rectangle);
extern int eqpt(Point, Point);
(DIR) diff --git a/libXg/Makefile b/libXg/Makefile
@@ -26,7 +26,7 @@ CC?=c99
OBJS= arith.o balloc.o bitblt.o border.o bscreenrect.o\
clipr.o cursorset.o cursorswitch.o\
font.o gcs.o getrect.o gwin.o ldconvert.o latin1.o\
- menuhit.o rdbitmap.o \
+ menuhit.o \
rectclip.o rune.o string.o strwidth.o texture.o\
wrbitmap.o xtbinit.o
(DIR) diff --git a/libXg/rdbitmap.c b/libXg/rdbitmap.c
@@ -1,63 +0,0 @@
-/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */
-#include <u.h>
-#include <libc.h>
-#include <libg.h>
-#include "libgint.h"
-
-void
-rdbitmap(Bitmap *b, int miny, int maxy, unsigned char *data)
-{
- XImage *gim, *eim;
- int x, y, w, h, pix, l, offset, px;
- int inld, outld;
- char *tdata;
-
- /*
- * The XGetImage returned image may be wrong in a number of ways:
- * wrong bit order, byte order, bit pad, scanline pad,
- * and constant shift.
- * So use a SLOW loop, for now
- */
- w = Dx(b->r);
- h = maxy - miny;
- outld = b->ldepth;
- inld = (b->ldepth == 0) ? 0 : screen.ldepth;
- gim = XGetImage(_dpy, (Drawable)b->id, 0, miny - b->r.min.y,
- w, h, ~0, ZPixmap);
- px = 1<<(3-outld); /* pixels per byte */
- /* set l to number of bytes of data per scan line */
- if(b->r.min.x >= 0)
- offset = b->r.min.x % px;
- else
- offset = px - b->r.min.x % px;
- l = (-b->r.min.x+px-1)/px;
- if(b->r.max.x >= 0)
- l += (b->r.max.x+px-1)/px;
- else
- l -= b->r.max.x/px;
- l *= h;
- if(l <= 0)
- return;
- tdata = (char *)malloc(l);
- if (tdata == (char *) 0)
- berror("rdbitmap malloc");
- eim = XCreateImage(_dpy, 0, 1 << inld, ZPixmap, 0, tdata,
- w+offset, h, 8, 0);
- eim->bitmap_pad = 8;
- eim->bitmap_bit_order = MSBFirst;
- eim->byte_order = MSBFirst;
-
- for(y = 0; y < h; y++)
- for(x = 0; x < w; x++) {
- pix = XGetPixel(gim, x, y);
- XPutPixel(eim, x+offset, y, pix);
- }
-
- if (inld == outld)
- memcpy((char *)data, tdata, l);
- else
- _ldconvert(tdata, inld, (char*)data, outld, w, h);
-
- XDestroyImage(gim);
- XDestroyImage(eim);
-}