From cd334c76ca8cf181a1cf37a691412c3d95679b93 Mon Sep 17 00:00:00 2001 From: Rong-En Fan Date: Mon, 22 Jan 2007 23:58:13 +0000 Subject: - Fix build on gcc 4. These two changes are stole from print/ghostscript-afpl. Original patches are submitted by Ron MacNeil in ports/94461. --- print/ghostscript-gpl/files/patch-lips:gdevl4v.c | 35 +-- .../ghostscript-gpl/files/patch-src_cpca_mk_cmd.c | 270 +++++++++++++++++++++ 2 files changed, 288 insertions(+), 17 deletions(-) create mode 100644 print/ghostscript-gpl/files/patch-src_cpca_mk_cmd.c (limited to 'print/ghostscript-gpl/files') diff --git a/print/ghostscript-gpl/files/patch-lips:gdevl4v.c b/print/ghostscript-gpl/files/patch-lips:gdevl4v.c index 37dc6d4f006c..8713a1469f3c 100644 --- a/print/ghostscript-gpl/files/patch-lips:gdevl4v.c +++ b/print/ghostscript-gpl/files/patch-lips:gdevl4v.c @@ -1,6 +1,6 @@ ---- lips/gdevl4v.c.orig Thu Nov 2 12:09:18 2000 -+++ lips/gdevl4v.c Tue Jan 13 01:30:38 2004 -@@ -230,41 +230,66 @@ +--- lips/gdevl4v.c.orig Thu Nov 2 05:09:18 2000 ++++ lips/gdevl4v.c Sun Jun 11 15:57:43 2006 +@@ -230,41 +230,67 @@ }; /* Vector device implementation */ @@ -24,26 +24,26 @@ +private int +lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop, + gs_logical_operation_t diff); - private int --lips4v_setlogop(P3 - -- (gx_device_vector * vdev, gs_logical_operation_t lop, -- gs_logical_operation_t diff)); ++private int ++ +lips4v_beginpath(gx_device_vector * vdev, gx_path_type_t type); +private int +lips4v_moveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x, + floatp y, gx_path_type_t type); - private int ++private int +lips4v_lineto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x, + floatp y, gx_path_type_t type); -+private int + private int +-lips4v_setlogop(P3 +lips4v_curveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x1, + floatp y1, floatp x2, floatp y2, floatp x3, floatp y3, + gx_path_type_t type); ++private int +lips4v_closepath(gx_device_vector * vdev, floatp x, floatp y, floatp x_start, + floatp y_start, gx_path_type_t type); --lips4v_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type)); +- (gx_device_vector * vdev, gs_logical_operation_t lop, +- gs_logical_operation_t diff)); +private int lips4v_endpath(gx_device_vector * vdev, gx_path_type_t type); +#else +private int lips4v_beginpage(P1(gx_device_vector * vdev)); @@ -57,8 +57,9 @@ +private int +lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop, + gs_logical_operation_t diff); -+private int -+ + private int + +-lips4v_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type)); +lips4v_beginpath(gx_device_vector * vdev, gx_path_type_t type); private int -lips4v_moveto(P6 @@ -92,7 +93,7 @@ private int lips4v_setlinewidth(gx_device_vector * vdev, floatp width); private int lips4v_setlinecap(gx_device_vector * vdev, gs_line_cap cap); private int lips4v_setlinejoin(gx_device_vector * vdev, gs_line_join join); -@@ -758,10 +783,26 @@ +@@ -758,10 +784,26 @@ /* 用紙サイズ */ if (pdev->prev_paper_size != paper_size) { if (paper_size == USER_SIZE) { @@ -121,7 +122,7 @@ lputs(s, paper); } else { sprintf(paper, "%c%dp", LIPS_CSI, paper_size); -@@ -770,12 +811,28 @@ +@@ -770,12 +812,28 @@ } else if (paper_size == USER_SIZE) { if (pdev->prev_paper_width != width || pdev->prev_paper_height != height) @@ -152,7 +153,7 @@ lputs(s, paper); } pdev->prev_paper_size = paper_size; -@@ -1881,7 +1938,7 @@ +@@ -1881,7 +1939,7 @@ } color_set_pure(&color, one); code = gdev_vector_update_fill_color((gx_device_vector *) pdev, @@ -161,7 +162,7 @@ } if (code < 0) return 0; -@@ -2026,7 +2083,7 @@ +@@ -2026,7 +2084,7 @@ if (w <= 0 || h <= 0) return 0; if (depth > 1 || diff --git a/print/ghostscript-gpl/files/patch-src_cpca_mk_cmd.c b/print/ghostscript-gpl/files/patch-src_cpca_mk_cmd.c new file mode 100644 index 000000000000..e7f1f9221946 --- /dev/null +++ b/print/ghostscript-gpl/files/patch-src_cpca_mk_cmd.c @@ -0,0 +1,270 @@ +--- src/cpca_mk_cmd.c.orig Wed Mar 15 15:00:26 2006 ++++ src/cpca_mk_cmd.c Wed Mar 15 15:33:26 2006 +@@ -586,6 +586,7 @@ + Ptr data ; + short size ; + Ptr work ; ++ short *swork ; + unsigned long comSize = 0 ; + + if (p && str) { +@@ -594,7 +595,9 @@ + if (data) { + work = data ; + +- *( ( short *)work )++ = id_val_code_set_Shift_JIS ; ++ swork = (short *)work ; ++ *swork++ = id_val_code_set_Shift_JIS ; ++ work = (Ptr)swork ; + memcpy( work, str, (unsigned char)str[ 0 ] + 1 ) ; + comSize = glue_cpcaSetJob( p, + Attribute, +@@ -867,6 +870,7 @@ + short size ; + Ptr data ; + Ptr work ; ++ unsigned short *uswork ; + unsigned long comSize = 0 ; + + if (p) { +@@ -877,8 +881,10 @@ + + *work++ = id_val_resolution_type_dpi ; + +- *( ( unsigned short *)work )++ = resolutionX ; +- *( ( unsigned short *)work )++ = resolutionY ; ++ uswork = (unsigned short *)work ; ++ *uswork++ = resolutionX ; ++ *uswork++ = resolutionY ; ++ work = (Ptr)uswork ; + + comSize = glue_cpcaSetDocument ( p, + id_att_resolution, +@@ -1597,6 +1603,8 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; ++ cpcaHANDLE *cpcaHANDLEp ; ++ cpcaUBYTE *cpcaUBYTEp ; + + + z_setUserInfo( userInfo, &userID, &password ) ; +@@ -1616,9 +1624,14 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaHANDLE *)p )++ = inParam->Object1 ; +- *( ( cpcaUBYTE *)p )++ = inParam->Mode ; +- *( ( cpcaHANDLE *)p )++ = inParam->Object2 ; ++ cpcaHANDLEp = (cpcaHANDLE *)p ; ++ *cpcaHANDLEp++ = inParam->Object1 ; ++ cpcaUBYTEp = (cpcaUBYTE *)cpcaHANDLEp ; ++ *cpcaUBYTEp++ = inParam->Mode ; ++ cpcaHANDLEp = (cpcaHANDLE *)cpcaUBYTEp ; ++ *cpcaHANDLEp++ = inParam->Object2 ; ++ p = (Ptr)cpcaHANDLEp ; ++ + comSize += 9; + + return comSize ; +@@ -1644,7 +1657,7 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; +- ++ cpcaATTRIB *cpcaATTRIBp; + + z_setUserInfo( userInfo, &userID, &password ) ; + paramSize = 2 + inParam->Size ; +@@ -1661,7 +1674,9 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaATTRIB *)p )++ = inParam->Attribute ; ++ cpcaATTRIBp = (cpcaATTRIB *)p ; ++ *cpcaATTRIBp++ = inParam->Attribute ; ++ p = (Ptr)cpcaATTRIBp ; + if ( inParam->Data && ( inParam->Size > 0 ) ) + { + memcpy( p, inParam->Data, inParam->Size ) ; +@@ -1687,6 +1702,7 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; ++ cpcaHANDLE *cpcaHANDLEp ; + + z_setUserInfo( userInfo, &userID, &password ) ; + paramSize = sizeof( cpcaHANDLE ) ; +@@ -1703,7 +1719,10 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaHANDLE *)p )++ = inParam->Object ; ++ cpcaHANDLEp = (cpcaHANDLE *)p ; ++ *cpcaHANDLEp++ = inParam->Object ; ++ p = (Ptr)cpcaHANDLEp ; ++ + comSize += paramSize ; + + return comSize ; +@@ -1723,6 +1742,7 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; ++ cpcaATTRIB *cpcaATTRIBp; + + z_setUserInfo( userInfo, &userID, &password ) ; + paramSize = sizeof( cpcaATTRIB ) + inParam->Size ; +@@ -1739,7 +1759,9 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaATTRIB *)p )++ = inParam->Attribute ; ++ cpcaATTRIBp = (cpcaATTRIB *)p; ++ *cpcaATTRIBp++ = inParam->Attribute ; ++ p = (Ptr)cpcaATTRIBp ; + if ( inParam->Data && ( inParam->Size > 0 ) ) + { + memcpy( p, inParam->Data, inParam->Size ) ; +@@ -1764,22 +1786,27 @@ + short comSize ; + Ptr work ; + char BindName; ++ unsigned char *ucwork ; + + work = p ; + + /* ビンエイリアスの設定 */ +- *( ( unsigned char *)work )++ = bindInfo; ++ ucwork = (unsigned char *)work ; ++ *ucwork++ = bindInfo; + /* ビン番号の設定=なし(0を指定) */ +- *( ( unsigned char *)work )++ = bindNum ; ++ *ucwork++ = bindNum ; + /* ビン名称指定 */ + /* null文字列指定 */ + BindName = 0; ++ work = (Ptr)ucwork ; + + memcpy( ( StringPtr )work, &BindName, 1 ) ; + work += 1 ; + /* 開始ビン、終了ビン指定 */ +- *( ( unsigned char *)work )++ = 0 ; +- *( ( unsigned char *)work )++ = 0 ; ++ ucwork = (unsigned char *)work ; ++ *ucwork++ = 0 ; ++ *ucwork++ = 0 ; ++ work = (Ptr)ucwork ; + /* サイズの取得 */ + comSize = work - p ; + +@@ -1803,19 +1830,24 @@ + Ptr work ; + char count; + char str_count; ++ unsigned char *ucwork ; ++ unsigned short *uswork ; + + work = p ; + count = 1; + str_count = 1; + + /* Type:フィニッシング方法の設定 */ +- *( ( unsigned char *)work )++ = str_count; ++ ucwork = (unsigned char *)work ; ++ *ucwork++ = str_count; + /* Type:フィニッシング方法の設定 */ +- *( ( unsigned char *)work )++ = id_val_finishing_type_staple_stitching; ++ *ucwork++ = id_val_finishing_type_staple_stitching; + /* Count:フィニッシングを行う個数 */ +- *( ( unsigned char *)work )++ = count ; ++ *ucwork++ = count ; + /* Locate:フィニッシングを行う箇所 */ +- *( ( unsigned short *)work )++ = staple_val; ++ uswork = (unsigned short *)ucwork ; ++ *uswork++ = staple_val; ++ work = (Ptr)uswork ; + /* サイズの取得 */ + comSize = work - p ; + +@@ -1839,6 +1871,7 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; ++ cpcaHANDLE *cpcaHANDLEp ; + + z_setUserInfo( userInfo, &userID, &password ) ; + paramSize = 4 ; +@@ -1855,7 +1888,9 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaHANDLE *)p )++ = inParam->Object ; ++ cpcaHANDLEp = (cpcaHANDLE *)p ; ++ *cpcaHANDLEp++ = inParam->Object ; ++ p = (Ptr)cpcaHANDLEp ; + comSize += paramSize ; + + return comSize ; +@@ -1876,7 +1911,7 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; +- ++ cpcaATTRIB *cpcaATTRIBp ; + + z_setUserInfo( userInfo, &userID, &password ) ; + paramSize = 2 + inParam->Size ; +@@ -1893,7 +1928,9 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaATTRIB *)p )++ = inParam->Attribute ; ++ cpcaATTRIBp = (cpcaATTRIB *)p ; ++ *cpcaATTRIBp++ = inParam->Attribute ; ++ p = (Ptr)cpcaATTRIBp ; + if ( inParam->Data && ( inParam->Size > 0 ) ) + { + memcpy( p, inParam->Data, inParam->Size ) ; +@@ -1918,6 +1955,8 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; ++ cpcaHANDLE *cpcaHANDLEp ; ++ cpcaUSHORT *cpcaUSHORTp ; + + z_setUserInfo( userInfo, &userID, &password ) ; + paramSize = 6 + inParam->Size ; +@@ -1934,8 +1973,11 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaHANDLE *)p )++ = inParam->Object ; +- *( ( cpcaUSHORT *)p )++ = inParam->Method ; ++ cpcaHANDLEp = (cpcaHANDLE *)p ; ++ *cpcaHANDLEp++ = inParam->Object ; ++ cpcaUSHORTp = (cpcaUSHORT *)cpcaHANDLEp ; ++ *cpcaUSHORTp++ = inParam->Method ; ++ p = (Ptr)cpcaUSHORTp ; + if ( inParam->Data && ( inParam->Size > 0 ) ) + { + memcpy( p, inParam->Data, inParam->Size ) ; +@@ -2075,6 +2117,7 @@ + short paramSize ; + unsigned long userID ; + unsigned long password ; ++ cpcaUBYTE *cpcaUBYTEp ; + + z_setUserInfo( userInfo, &userID, &password ) ; + paramSize = 1 ; +@@ -2091,7 +2134,9 @@ + p += comSize ; + + /* 固有パラメータの設定 */ +- *( ( cpcaUBYTE *)p )++ = inParam->Code ; ++ cpcaUBYTEp = (cpcaUBYTE *)p ; ++ *cpcaUBYTEp++ = inParam->Code ; ++ p = (Ptr)cpcaUBYTEp ; + comSize += paramSize ; + + return comSize ; -- cgit v1.2.3