$NetBSD: patch-af,v 1.2 2012/06/13 08:15:14 mef Exp $

Convert varargs-macros to old-style macros, to make the package
compile when using gcc 2.95.

--- src/xfstt.cc.orig	2012-03-21 02:23:17.000000000 +0900
+++ src/xfstt.cc	2012-06-13 11:47:32.000000000 +0900
@@ -436,7 +436,7 @@
 	} else
 		mapIndex = 0;
 
-	debug("match\t\"%s\"\n", buf0 + 1);
+	debug1("match\t\"%s\"\n", buf0 + 1);
 
 	*buf0 = buf - buf0;
 	return *buf0 + 1;
@@ -495,7 +495,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;
 }
@@ -509,7 +509,7 @@
 		if (fid == xfs->fid)
 			return xfs;
 
-	debug("fid = %ld not found!\n", fid);
+	debug1("fid = %ld not found!\n", fid);
 
 	return 0;
 }
@@ -529,7 +529,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)
@@ -587,7 +587,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
@@ -630,7 +630,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;
@@ -769,8 +769,8 @@
 	if (!encoding)
 		encoding = encodings[0];
 
-	debug("\nopenXLFD(\"%s\"), %s\n", xlfdName, encoding->Name.c_str());
-	debug("size %d, resx %d, resy %d\n",
+	debug2("\nopenXLFD(\"%s\"), %s\n", xlfdName, encoding->Name.c_str());
+	debug3("size %d, resx %d, resy %d\n",
 	      fp->point[0], fp->resolution[0], fp->resolution[1]);
 
 	TTFNdata* ttfn = (TTFNdata *)(infoBase + sizeof(TTFNheader));
@@ -1047,7 +1047,7 @@
 			conn.sd_max = conn.sd_list[n];
 	}
 
-	debug("connection setup (sockets = %d)\n", conn.sd_list_used);
+	debug1("connection setup (sockets = %d)\n", conn.sd_list_used);
 
 	return 0;
 }
@@ -1074,7 +1074,7 @@
 		}
 	}
 
-	debug("accept(%d) = %d\n", conn.sd_list[n], sd);
+	debug2("accept(%d) = %d\n", conn.sd_list[n], sd);
 
 	return sd;
 }
@@ -1097,9 +1097,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' && (*(uint32_t *)req & 0xff) != 'l') ||
 	    (req->byteOrder == 'B' && ((*(uint32_t *)req >> 24) & 0xff) != 'B'))
@@ -1150,7 +1150,7 @@
 
 	register uint8_t *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:
@@ -1182,7 +1182,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)
@@ -1246,7 +1246,7 @@
 	int size = client.req.length << 2;
 
 	if (size < expected_size) {
-		debug("packet size mismatch: %d received bytes, "
+		debug2("packet size mismatch: %d received bytes, "
 		      "%d expected bytes\n", size, expected_size);
 		fs_client_error(client, FSBadLength);
 		return 0;
@@ -1277,14 +1277,14 @@
 #ifdef DEBUG
 		debug("===STARTREQ=========== %d\n", l);
 		for (i = 0; i < sz_fsReq; ++i)
-			debug("%02X ", client.buf[i]);
+			debug1("%02X ", client.buf[i]);
 		debug("\n");
 		sync();
 #endif
 
 		int size = client.req.length << 2;
 		if (size > MAXREQSIZE) {
-			debug("too much data: %d bytes (max=%d)\n",
+			debug2("too much data: %d bytes (max=%d)\n",
 			      size, MAXREQSIZE);
 			fs_client_error(client, FSBadLength);
 			break;
@@ -1298,13 +1298,13 @@
 
 #ifdef DEBUG
 		for (i = sz_fsReq; i < size; ++i) {
-			debug("%02X ", client.buf[i]);
+			debug1("%02X ", client.buf[i]);
 			if ((i & 3) == 3)
 				debug(" ");
 			if ((i & 15) == (15 - sz_fsReq))
 				debug("\n");
 		}
-		debug("\n===ENDREQ============= %d\n", size);
+		debug1("\n===ENDREQ============= %d\n", size);
 		sync();
 #endif
 
@@ -1382,12 +1382,12 @@
 			{
 			fsSetEventMaskReq *req = (fsSetEventMaskReq *)client.buf;
 			client.event_mask = req->event_mask;
-			debug("FS_SetEventMask %04X\n", client.event_mask);
+			debug1("FS_SetEventMask %04X\n", client.event_mask);
 			}
 			break;
 
 		case FS_GetEventMask:
-			debug("FS_GetEventMask = %04X\n", client.event_mask);
+			debug1("FS_GetEventMask = %04X\n", client.event_mask);
 			{
 			fsGetEventMaskReply reply;
 			reply.type = FS_Reply;
@@ -1441,7 +1441,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;
@@ -1450,7 +1450,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);
 			}
@@ -1489,7 +1489,7 @@
 				break;
 
 			pattern[req->nbytes] = 0;
-			debug("FS_ListFonts \"%s\" * %ld\n",
+			debug2("FS_ListFonts \"%s\" * %ld\n",
 			      pattern, req->maxNames);
 
 			fsListFontsReply reply;
@@ -1523,7 +1523,7 @@
 				buf += len;
 				++reply.nFonts;
 			}
-			debug("Found %ld fonts\n", reply.nFonts);
+			debug1("Found %ld fonts\n", reply.nFonts);
 			reply.length = (sizeof(reply) + (buf - client.replybuf)
 				       + 3) >> 2;
 
@@ -1562,7 +1562,7 @@
 			fsOpenBitmapFontReq *req = (fsOpenBitmapFontReq *)client.buf;
 			char *fontName = (char *)(req + 1) + 1;
 			fontName[*(uint8_t *)(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)
@@ -1585,7 +1585,7 @@
 				fs_client_error(client, FSBadName);
 				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;
@@ -1593,7 +1593,7 @@
 		case FS_QueryXInfo:
 			{
 			fsQueryXInfoReq *req = (fsQueryXInfoReq *)client.buf;
-			debug("FS_QueryXInfo fid = %ld\n", req->id);
+			debug1("FS_QueryXInfo fid = %ld\n", req->id);
 
 			struct {
 				fsQueryXInfoReply s1;
@@ -1625,10 +1625,10 @@
 			reply.s1.font_hdr_char_range_max_char_low
 				= (uint8_t)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);
 
@@ -1652,11 +1652,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
@@ -1680,10 +1680,10 @@
 			{
 			fsQueryXExtents16Req *req = (fsQueryXExtents16Req *)client.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)
@@ -1722,7 +1722,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 (uint16_t j = ptr[0]; j <= ptr[1]; ++j)
 						(ext++)->left = j;
 				}
@@ -1762,10 +1762,10 @@
 				}
 
 #if DEBUG & 2
-				debug("GM[%3d = %3d] = ", ch, glyphNo);
-				debug("(l= %d, r= %d, ",
+				debug1("GM[%3d = %3d] = ", ch, glyphNo);
+				debug2("(l= %d, r= %d, ",
 				      ext->left, ext->right);
-				debug("w= %d, a= %d, d= %d);\n",
+				debug3("w= %d, a= %d, d= %d);\n",
 				      ext->width, ext->ascent, ext->descent);
 #endif
 			}
@@ -1780,9 +1780,9 @@
 			{
 			fsQueryXBitmaps16Req *req = (fsQueryXBitmaps16Req *)client.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)
@@ -1823,7 +1823,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 (uint16_t j = ptr[0]; j <= ptr[1]; ++j)
 						(ofs++)->position = j;
 				}
@@ -1868,7 +1868,7 @@
 				ofs->position = ci->tmpofs;
 
 #if DEBUG & 2
-				debug("OFS[%3d = %3d] = %ld\n",
+				debug2("OFS[%3d = %3d] = %ld\n",
 				      ch, glyphNo, ofs->position);
 #endif
 			}
@@ -1905,7 +1905,7 @@
 		case FS_CloseFont:
 			{
 			fsCloseReq *req = (fsCloseReq *)client.buf;
-			debug("FS_CloseFont fid = %ld\n", req->id);
+			debug1("FS_CloseFont fid = %ld\n", req->id);
 
 			XFSFont *xfs = fs_find_font(req->id, client);
 			if (xfs) {
@@ -1917,7 +1917,7 @@
 			break;
 
 		default:
-			debug("Unknown FS request 0x%02X !\n", client.req.reqType);
+			debug1("Unknown FS request 0x%02X !\n", client.req.reqType);
 			fs_client_error(client, FSBadRequest);
 			break;
 		}
