$NetBSD$

--- src/xfstt.cc.orig	Thu Aug  7 08:31:47 2003
+++ src/xfstt.cc	Sat Feb 14 23:04:55 2004
@@ -397,7 +397,7 @@
 	} else
 		mapIndex = 0;
 
-	debug("match\t\"%s\"\n", buf0 + 1);
+	debug1("match\t\"%s\"\n", buf0 + 1);
 
 	*buf0 = buf - buf0;
 	return *buf0 + 1;
@@ -451,7 +451,7 @@
 	strncpy(buf, (char *)&fn, sizeof(fn));
 	strncpy(buf + sizeof(fn), fontName, ttfn->nameLen);
 	buf[fn.nameLen] = 0;
-	debug("ListFont \"%s\"\n", buf);
+	debug1("ListFont \"%s\"\n", buf);
 
 	return fn.nameLen + 1;
 }
@@ -464,7 +464,7 @@
 		if (fid == xfs->fid)
 			return xfs;
 
-	debug("fid = %ld not found!\n", fid);
+	debug1("fid = %ld not found!\n", fid);
 
 	if (sd) {
 		fsError reply;
@@ -482,7 +482,7 @@
 openFont(TTFont *ttFont, FontParams *fp, Rasterizer *raster,
 	 int fid, Encoding *encoding)
 {
-	debug("point %d, pixel %d, res %d\n",
+	debug3("point %d, pixel %d, res %d\n",
 	      fp->point[0], fp->pixel[0], fp->resolution[0]);
 
 	if (!ttFont || ttFont->badFont())
@@ -536,7 +536,7 @@
 		fp->point[3] = (fp->pixel[3] * 72 + 36) / fp->resolution[1];
 	}
 
-	debug("point %d, pixel %d, res %d\n", fp->point[0], fp->pixel[0],
+	debug3("point %d, pixel %d, res %d\n", fp->point[0], fp->pixel[0],
 	      fp->resolution[0]);
 
 	// init rasterizer
@@ -576,7 +576,7 @@
 		return 0;
 
 	// parse attributes
-	debug("point %d, pixel %d, res %d\n",
+	debug3("point %d, pixel %d, res %d\n",
 	      fp->point[0], fp->pixel[0], fp->resolution[0]);
 
 	int m_index = 0, p_index = 0, r_index = 0;
@@ -701,8 +701,8 @@
 	if (!encoding)
 		encoding = encodings[0];
 
-	debug("\nopenXLFD(\"%s\"), %s\n", xlfdName, encoding->strName);
-	debug("size %d, resx %d, resy %d\n",
+	debug2("\nopenXLFD(\"%s\"), %s\n", xlfdName, encoding->strName);
+	debug3("size %d, resx %d, resy %d\n",
 	      fp->point[0], fp->resolution[0], fp->resolution[1]);
 
 	TTFNdata* ttfn = (TTFNdata *)(infoBase + sizeof(TTFNheader));
@@ -876,7 +876,7 @@
 		sd = accept(sd_unix, (struct sockaddr *)&s_unix, &saLength);
 	else if (!noTCP && FD_ISSET(sd_inet, &sdlist))
 		sd = accept(sd_inet, (struct sockaddr *)&s_inet, &saLength);
-	debug("accept(saLength = %d) = %d\n", saLength, sd);
+	debug2("accept(saLength = %d) = %d\n", saLength, sd);
 
 	return sd;
 }
@@ -901,9 +901,9 @@
 		return 0;
 	}
 
-	debug("%s endian connection\n",
+	debug1("%s endian connection\n",
 	      (req->byteOrder == 'l') ? "little" : "big");
-	debug("version %d.%d\n", req->major_version, req->minor_version);
+	debug2("version %d.%d\n", req->major_version, req->minor_version);
 
 	if ((req->byteOrder == 'l' && (*(U32 *)req & 0xff) != 'l')
 	    || (req->byteOrder == 'B' && ((*(U32 *)req >> 24) & 0xff) != 'B')) {
@@ -955,7 +955,7 @@
 
 	register U8 *p, *end = fe->bitmaps + fe->bmplen;
 	if ((fe->bmpFormat ^ hint) & BitmapFormatMaskByte) {
-		debug("slpswap SLP=%d\n", LOGSLP);
+		debug1("slpswap SLP=%d\n", LOGSLP);
 		p = fe->bitmaps;
 		switch (LOGSLP) {
 		case 3:
@@ -987,7 +987,7 @@
 	}
 
 	if ((format != LOGSLP) && (hint & BitmapFormatByteOrderMask == 0)) {
-		debug("fmtswap SLP=%d -> fmt=%d\n", LOGSLP, format);
+		debug2("fmtswap SLP=%d -> fmt=%d\n", LOGSLP, format);
 		p = fe->bitmaps;
 		if (LOGSLP == 3 && format == 4) {
 			for (; p < end; p += 2)
@@ -1045,7 +1045,7 @@
 check_length(int sd, int seqno, fsReq *req, int expected_size)
 {
 	if (req->length < (expected_size >> 2)) {
-		debug("packet size mismatch: %d received bytes, "
+		debug2("packet size mismatch: %d received bytes, "
 		      "%d expected bytes\n", req->length << 2, expected_size);
 		send_fserror(sd, seqno);
 		return 0;
@@ -1080,7 +1080,7 @@
 		fsReq *fsreq = (fsReq *)buf;
 		int length = fsreq->length << 2;
 		if (length > MAXREQSIZE) {
-			debug("too much data: %d bytes (max=%d)\n",
+			debug2("too much data: %d bytes (max=%d)\n",
 			      length, MAXREQSIZE);
 			send_fserror(sd, seqno);
 			break;
@@ -1182,12 +1182,12 @@
 			{
 			fsSetEventMaskReq *req = (fsSetEventMaskReq *)buf;
 			event_mask = req->event_mask;
-			debug("FS_SetEventMask %04X\n", event_mask);
+			debug1("FS_SetEventMask %04X\n", event_mask);
 			}
 			break;
 
 		case FS_GetEventMask:
-			debug("FS_GetEventMask = %04X\n", event_mask);
+			debug1("FS_GetEventMask = %04X\n", event_mask);
 			{
 			fsGetEventMaskReply reply;
 			reply.type = FS_Reply;
@@ -1241,7 +1241,7 @@
 
 			fsResolution *res = (fsResolution *)(req + 1);
 
-			debug("FS_SetResolution * %d\n", numres);
+			debug1("FS_SetResolution * %d\n", numres);
 			for (; --numres >= 0; ++res) {
 				if (!defaultres) {
 					fp0.resolution[0] = res->x_resolution;
@@ -1250,7 +1250,7 @@
 				res->point_size /= 10;
 				fp0.point[0] = fp0.point[1] = res->point_size;
 				fp0.point[2] = fp0.point[3] = 0;
-				debug("xres = %d, yres = %d, size = %d\n",
+				debug3("xres = %d, yres = %d, size = %d\n",
 				      res->x_resolution, res->y_resolution,
 				      res->point_size / 10);
 			}
@@ -1289,7 +1289,7 @@
 				break;
 
 			pattern[req->nbytes] = 0;
-			debug("FS_ListFonts \"%s\" * %ld\n",
+			debug2("FS_ListFonts \"%s\" * %ld\n",
 			      pattern, req->maxNames);
 
 			fsListFontsReply reply;
@@ -1323,7 +1323,7 @@
 				buf += len;
 				++reply.nFonts;
 			}
-			debug("Found %ld fonts\n", reply.nFonts);
+			debug1("Found %ld fonts\n", reply.nFonts);
 			reply.length = (sizeof(reply) + (buf - replybuf)
 				       + 3) >> 2;
 
@@ -1358,7 +1358,7 @@
 			error.sequenceNumber = seqno;
 			error.length = sizeof(error) >> 2;
 
-			debug(" fsError size = %u bytes, %u ints\n",
+			debug2(" fsError size = %u bytes, %u ints\n",
 			      sizeof(error), error.length);
 			write(sd, (void *)&error, sizeof(error));
 #endif
@@ -1370,7 +1370,7 @@
 			fsOpenBitmapFontReq *req = (fsOpenBitmapFontReq *)buf;
 			char *fontName = (char *)(req + 1) + 1;
 			fontName[*(U8 *)(req + 1)] = 0;
-			debug("FS_OpenBitmapFont \"%s\"", fontName);
+			debug1("FS_OpenBitmapFont \"%s\"", fontName);
 
 			raster->format = (req->format_hint >> 8) & 3;
 			if (req->format_hint & 0x0c)
@@ -1399,7 +1399,7 @@
 				write(sd, (void *)&reply, sizeof(reply));
 				debug(" not found\n");
 			}
-			debug("fhint = %04lX, fmask = %04lX, fid = %ld\n",
+			debug3("fhint = %04lX, fmask = %04lX, fid = %ld\n",
 			      req->format_hint, req->format_mask, req->fid);
 			}
 			break;
@@ -1407,7 +1407,7 @@
 		case FS_QueryXInfo:
 			{
 			fsQueryXInfoReq *req = (fsQueryXInfoReq *)buf;
-			debug("FS_QueryXInfo fid = %ld\n", req->id);
+			debug1("FS_QueryXInfo fid = %ld\n", req->id);
 
 			struct {
 				fsQueryXInfoReply s1;
@@ -1439,10 +1439,10 @@
 			reply.s1.font_hdr_char_range_max_char_low
 				= (U8)fi->lastChar;
 
-			debug("minchar = 0x%02X%02X, ",
+			debug2("minchar = 0x%02X%02X, ",
 			      reply.s1.font_hdr_char_range_min_char_high,
 			      reply.s1.font_hdr_char_range_min_char_low);
-			debug("maxchar = 0x%02X%02X\n",
+			debug2("maxchar = 0x%02X%02X\n",
 			      reply.s1.font_hdr_char_range_max_char_high,
 			      reply.s1.font_hdr_char_range_max_char_low);
 
@@ -1466,11 +1466,11 @@
 			reply.s1.font_header_font_ascent = fe->yWinAscent;
 			reply.s1.font_header_font_descent = fe->yWinDescent;
 
-			debug("FM= (asc= %d, dsc= %d, ",
+			debug2("FM= (asc= %d, dsc= %d, ",
 			      fe->yAscentMax, fe->yDescentMax);
-			debug("wasc= %d, wdsc= %d, ",
+			debug2("wasc= %d, wdsc= %d, ",
 			      fe->yWinAscent, fe->yWinDescent);
-			debug("wmin= %d, wmax= %d)\n",
+			debug2("wmin= %d, wmax= %d)\n",
 			      fe->xAdvanceMin, fe->xAdvanceMax);
 
 			// we need to have some property data, otherwise
@@ -1494,10 +1494,10 @@
 			{
 			fsQueryXExtents16Req *req = (fsQueryXExtents16Req *)buf;
 
-			debug("FS_QueryXExtents%s fid = %ld, ",
+			debug2("FS_QueryXExtents%s fid = %ld, ",
 			      (req->reqType == FS_QueryXExtents8 ? "8" : "16"),
 			      req->fid);
-			debug("range=%d, nranges=%ld\n",
+			debug2("range=%d, nranges=%ld\n",
 			      req->range, req->num_ranges);
 
 			int item_size = (req->reqType == FS_QueryXExtents8)
@@ -1535,7 +1535,7 @@
 				for (; nranges > 0; nranges -= 2, ptr += 2) {
 					ptr[0] = ntohs(ptr[0]);
 					ptr[1] = ntohs(ptr[1]);
-					debug("rg %d..%d\n",ptr[0],ptr[1]);
+					debug2("rg %d..%d\n",ptr[0],ptr[1]);
 					for (U16 j = ptr[0]; j <= ptr[1]; ++j)
 						(ext++)->left = j;
 				}
@@ -1591,9 +1591,9 @@
 			{
 			fsQueryXBitmaps16Req *req = (fsQueryXBitmaps16Req *)buf;
 
-			debug("FS_QueryXBitmaps16 fid = %ld, fmt = %04lX\n",
+			debug2("FS_QueryXBitmaps16 fid = %ld, fmt = %04lX\n",
 			      req->fid, req->format);
-			debug("range=%d, nranges=%ld\n",
+			debug2("range=%d, nranges=%ld\n",
 			      req->range, req->num_ranges);
 
 			int item_size = (req->reqType == FS_QueryXExtents8)
@@ -1633,7 +1633,7 @@
 				for (; nranges > 0; nranges -= 2, ptr += 2) {
 					ptr[0] = ntohs(ptr[0]);
 					ptr[1] = ntohs(ptr[1]);
-					debug("rg %d..%d\n",ptr[0],ptr[1]);
+					debug2("rg %d..%d\n",ptr[0],ptr[1]);
 					for (U16 j = ptr[0]; j <= ptr[1]; ++j)
 						(ofs++)->position = j;
 				}
@@ -1713,7 +1713,7 @@
 		case FS_CloseFont:
 			{
 			fsCloseReq *req = (fsCloseReq *)buf;
-			debug("FS_CloseFont fid = %ld\n", req->id);
+			debug1("FS_CloseFont fid = %ld\n", req->id);
 
 			XFSFont *xfs = findFont(req->id, sd, seqno);
 			if (xfs) {
@@ -1725,7 +1725,7 @@
 			break;
 
 		default:
-			debug("Unknown FS request 0x%02X !\n", fsreq->reqType);
+			debug1("Unknown FS request 0x%02X !\n", fsreq->reqType);
 			{
 			fsRequestError reply;
 			reply.type = FS_Error;
