[Rd] DEC cc doesn't like c++ comments (PR#416)

albrecht.gbehardt@uni-klu.ac.at albrecht.gbehardt@uni-klu.ac.at
Tue, 8 Feb 2000 10:56:57 +0100 (MET)


Full_Name: Albrecht Gebhardt
Version: 0.99.0
OS: alpha, osf4.0 
Submission from: (NULL) (143.205.180.40)


DEC cc doesn't like c++ style comments // like this one
Please use standard cc comments or #if 0 ... #endif 

A quite large patch follows 
(I hope it will pass mailing with not too much wrapped lines):
--- ./src/main/g_her_glyph.c.dec-cc.patch	Mon Feb  7 14:48:10 2000
+++ ./src/main/g_her_glyph.c	Mon Feb  7 14:49:40 2000
@@ -118,7 +118,7 @@
 /* PAUL MURRELL
    sys-defines.h not used 
 */
-// #include "sys-defines.h"
+/* #include "sys-defines.h" */
 
 /* PAUL MURRELL
    extern.h renamed g_extern.h
--- ./src/main/g_fontdb.c.dec-cc.patch	Mon Feb  7 14:48:10 2000
+++ ./src/main/g_fontdb.c	Mon Feb  7 14:49:40 2000
@@ -20,7 +20,7 @@
 /* PAUL MURRELL
    sys-defines.h not used 
 */
-// #include "sys-defines.h"
+/* #include "sys-defines.h" */
 
 /* PAUL MURRELL
    extern.h renamed g_extern.h
--- ./src/main/g_cntrlify.c.dec-cc.patch	Mon Feb  7 14:48:11 2000
+++ ./src/main/g_cntrlify.c	Mon Feb  7 14:49:40 2000
@@ -59,7 +59,7 @@
 /* PAUL MURRELL
    sys-defines.h not used
 */
-// #include "sys-defines.h"
+/* #include "sys-defines.h" */
 
 /* PAUL MURRELL
    extern.h renamed g_extern.h
@@ -209,7 +209,7 @@
 
       /* if current font is Hershey, first try to match each ligature
          pattern (no ligatures supported in non-Hershey fonts) */
-      if (1) // _plotter->drawstate->font_type == F_HERSHEY)
+      if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
 	{
 	  int i;
 	  bool matched = false;
@@ -235,7 +235,7 @@
       if (c != (unsigned char)'\\') /* ordinary char, may pass through */
 	{
 	  /* if current font is an ISO-Latin-1 Hershey font ... */
-	    if (1 // _plotter->drawstate->font_type == F_HERSHEY
+	    if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
 	      && _hershey_font_info[raw_fontnum].iso8859_1)
 	    {
 	      int i;
@@ -334,7 +334,7 @@
 	  esc[2] = (unsigned char)'\0';	/* have an escape sequence */
 	  
 	  /* is this an escape seq. (e.g. \#H0001) for a raw Hershey glyph? */
-	  if (1 // _plotter->drawstate->font_type == F_HERSHEY
+	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
 	      && esc[0] == '#' && esc[1] == 'H'
 	      && src[0] >= '0' && src[0] <= '9'
 	      && src[1] >= '0' && src[1] <= '9'
@@ -356,7 +356,7 @@
 #ifndef NO_KANJI
 	  /* is this an escape seq. (e.g. \#N0001) for a raw Japanese
              Hershey glyph (Kanji), as numbered in Nelson's dictionary? */
-	  if (1 // _plotter->drawstate->font_type == F_HERSHEY
+	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
 	      && esc[0] == '#' && esc[1] == 'N'
 	      && src[0] >= '0' && src[0] <= '9'
 	      && src[1] >= '0' && src[1] <= '9'
@@ -378,7 +378,7 @@
 
 	  /* is this an escape seq. (e.g. \#J0001) for a raw Japanese
              Hershey glyph (JIS numbering, in hex)? */
-	  if (1 // _plotter->drawstate->font_type == F_HERSHEY
+	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
 	      && esc[0] == '#' && esc[1] == 'J'
 	      && ((src[0] >= '0' && src[0] <= '9')
 		  || (src[0] >= 'a' && src[0] <= 'f')
@@ -506,7 +506,7 @@
 	  /* if current font is an ISO-Latin-1 Hershey font, is this an
 	     escape sequence for an 8-bit (non-ASCII) char, which due to
 	     nonexistence should be deligatured? */
-	  if (1 // _plotter->drawstate->font_type == F_HERSHEY
+	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
 	      && _hershey_font_info[raw_fontnum].iso8859_1)
 	    {
 	      int i;
@@ -553,7 +553,7 @@
 		  && _plotter->drawstate->font_is_iso8859_1
 		  && raw_fontnum == 1))
 */
-	  if (1 // _plotter->drawstate->font_type == F_HERSHEY
+	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
 	      && _hershey_font_info[raw_fontnum].iso8859_1)
 	    {
 	      bool matched = false;
@@ -568,7 +568,7 @@
 		{
 		  /* certain such characters are drawn in the Hershey fonts
                      as superscripts */
-		    if (1) // _plotter->drawstate->font_type == F_HERSHEY)
+		    if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
 		    {
 		      int k;
 		      bool matched2 = false;
@@ -622,7 +622,7 @@
 	  /* is this an escape seq. for a `special' (non-ISO, non-Symbol)
 	     Hershey glyph?  Such glyphs include astronomical signs, and
 	     `final s'. */
-	  if (1) // _plotter->drawstate->font_type == F_HERSHEY)
+	  if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
 	    {
 	      bool matched = false;
 
@@ -684,22 +684,24 @@
 	  /* PAUL MURRELL
 	     Only concerned with Hershey fonts
 	  */
-	  // if (strcmp ((char *)esc, "rn") == 0)
-	  //	    {
-	  //  if (_plotter->drawstate->font_type == F_POSTSCRIPT
-	  //  || _plotter->drawstate->font_type == F_PCL)
-	  // {
-	  //  dest[j++] 
-	  //    = (unsigned short)(CONTROL_CODE | C_LEFT_RADICAL_SHIFT);
+#if 0
+	   if (strcmp ((char *)esc, "rn") == 0)
+	  	    {
+	    if (_plotter->drawstate->font_type == F_POSTSCRIPT
+	    || _plotter->drawstate->font_type == F_PCL)
+	   {
+	    dest[j++] 
+	      = (unsigned short)(CONTROL_CODE | C_LEFT_RADICAL_SHIFT);
 		  /* take `radicalex' glyph from PS symbol font */
-	  //  dest[j++] 
-	  //    = symbol_fontword | (unsigned short)RADICALEX; 
-	  //  dest[j++] 
-	  //    = (unsigned short)(CONTROL_CODE | C_RIGHT_RADICAL_SHIFT);
-
-	  //  continue;	/* back to top of while loop */
-	  // }
-	  // }
+	    dest[j++] 
+	      = symbol_fontword | (unsigned short)RADICALEX; 
+	    dest[j++] 
+	      = (unsigned short)(CONTROL_CODE | C_RIGHT_RADICAL_SHIFT);
+
+	    continue;	/* back to top of while loop */
+	   }
+	   }
+#endif
 
 	  /* Attempt to parse as a font-change command, i.e. as one of the
 	     macros \f0, \f1, \f2, etc., or \fP.  \fR, \fI, \fB are the
@@ -708,77 +710,78 @@
 	  /* PAUL MURRELL
 	     won't handle font commands
 	  */
-	  // if (esc[0] == 'f' && ((esc[1] >= '0' && esc[1] <= '9')
-	  //		|| esc[1] == 'P' || esc[1] == 'R'
-	  //		|| esc[1] == 'I' || esc[1] == 'B'))
-	  // {
+#if 0
+	   if (esc[0] == 'f' && ((esc[1] >= '0' && esc[1] <= '9')
+	  		|| esc[1] == 'P' || esc[1] == 'R'
+	  		|| esc[1] == 'I' || esc[1] == 'B'))
+	   {
 	      /* If a user-specified, device-specific font [e.g. an X font,
 		 for which we have no internal table listing the other
 		 fonts in its family] is being used, we can't really do
 		 font switching, except via \f0, \f1.  These switch to the
 		 X symbol font and the current user-specified font,
 		 respectively.  (\fP is also supported.) */
-	  // if (_plotter->drawstate->font_type == F_OTHER
-	  //  && ((esc[1] >= '2' && esc[1] <= '9')
-	  //      || esc[1] == 'I' || esc[1] == 'B'))
-	  // esc[1] = '1'; /* treat as \f1 */
+	   if (_plotter->drawstate->font_type == F_OTHER
+	    && ((esc[1] >= '2' && esc[1] <= '9')
+	        || esc[1] == 'I' || esc[1] == 'B'))
+	   esc[1] = '1'; /* treat as \f1 */
 	      
 	      /* troff compatibility */
-	  // if (esc[1] == 'R')
-	  // esc[1] = '1';
-	  // else if (esc[1] == 'I')
-	  // esc[1] = '2';
-	  // else if (esc[1] == 'B')
-	  // esc[1] = '3';
-
-	  // if (esc[1] == 'P') /* \fP seen, so go back to previous font */
-	  // raw_fontnum = previous_raw_fontnum;
-	  // else		/* font specified as index into typeface */
-	  // {
-	  //  int new_font_index = esc[1] - '0';
+	   if (esc[1] == 'R')
+	   esc[1] = '1';
+	   else if (esc[1] == 'I')
+	   esc[1] = '2';
+	   else if (esc[1] == 'B')
+	   esc[1] = '3';
+
+	   if (esc[1] == 'P') /* \fP seen, so go back to previous font */
+	   raw_fontnum = previous_raw_fontnum;
+	   else		/* font specified as index into typeface */
+	   {
+	    int new_font_index = esc[1] - '0';
 
 		  /* switch to specified font (OOB tests here now obsolete?) */
-	  //  previous_raw_fontnum = raw_fontnum;
-	  //  switch (_plotter->drawstate->font_type)
-	  //    {
-	  //    case F_HERSHEY:
-	  //      if ((new_font_index >=
_hershey_typeface_info[_plotter->drawstate->typeface_index].numfonts)
-	  //	  || new_font_index < 0)
-	  //	new_font_index = 1; /* OOB -> use default font */
-	  //      raw_fontnum =
_hershey_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
-	  //      break;
-	  //    case F_PCL:
-	  //      if ((new_font_index >=
_pcl_typeface_info[_plotter->drawstate->typeface_index].numfonts)
-	  //	  || new_font_index < 0)
-	  //	new_font_index = 1; /* OOB -> use default font */
-	  //      raw_fontnum =
_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
-	  //      break;
-	  //    case F_STICK:
-	  //      if ((new_font_index >=
_stick_typeface_info[_plotter->drawstate->typeface_index].numfonts)
-	  //	  || new_font_index < 0)
-	  //	new_font_index = 1; /* OOB -> use default font */
-	  //      raw_fontnum =
_stick_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
-	  //      break;
-	  //    case F_POSTSCRIPT:
-	  //    default:
-	  //      if ((new_font_index >=
_ps_typeface_info[_plotter->drawstate->typeface_index].numfonts)
-	  //	  || new_font_index < 0)
-	  //	new_font_index = 1; /* OOB -> use default font */
-	  //      raw_fontnum =
_ps_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
-	  //      break;
-	  //    case F_OTHER:
-	  //      if (new_font_index != 0 && new_font_index != 1)
-	  //	new_font_index = 1; /* OOB -> use default font */
-	  //      raw_fontnum = new_font_index;
-	  //      break;
-	  //    }
-	  // }
+	    previous_raw_fontnum = raw_fontnum;
+	    switch (_plotter->drawstate->font_type)
+	      {
+	      case F_HERSHEY:
+	        if ((new_font_index >=
_hershey_typeface_info[_plotter->drawstate->typeface_index].numfonts)
+	  	  || new_font_index < 0)
+	  	new_font_index = 1; /* OOB -> use default font */
+	        raw_fontnum =
_hershey_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
+	        break;
+	      case F_PCL:
+	        if ((new_font_index >=
_pcl_typeface_info[_plotter->drawstate->typeface_index].numfonts)
+	  	  || new_font_index < 0)
+	  	new_font_index = 1; /* OOB -> use default font */
+	        raw_fontnum =
_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
+	        break;
+	      case F_STICK:
+	        if ((new_font_index >=
_stick_typeface_info[_plotter->drawstate->typeface_index].numfonts)
+	  	  || new_font_index < 0)
+	  	new_font_index = 1; /* OOB -> use default font */
+	        raw_fontnum =
_stick_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
+	        break;
+	      case F_POSTSCRIPT:
+	      default:
+	        if ((new_font_index >=
_ps_typeface_info[_plotter->drawstate->typeface_index].numfonts)
+	  	  || new_font_index < 0)
+	  	new_font_index = 1; /* OOB -> use default font */
+	        raw_fontnum =
_ps_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index];
+	        break;
+	      case F_OTHER:
+	        if (new_font_index != 0 && new_font_index != 1)
+	  	new_font_index = 1; /* OOB -> use default font */
+	        raw_fontnum = new_font_index;
+	        break;
+	      }
+	   }
 
-	  //	      fontword = ((unsigned short)raw_fontnum) << FONT_SHIFT;
+	  	      fontword = ((unsigned short)raw_fontnum) << FONT_SHIFT;
 
-	  //  continue;		/* back to top of while loop */
-	  // }
-	  
+	    continue;		/* back to top of while loop */
+	   }
+#endif	  
 	  /* couldn't match; unknown escape seq., so pass through unchanged */
 	  dest[j++] = fontword | (unsigned short)'\\';
 	  dest[j++] = fontword | (unsigned short)c;
--- ./src/main/g_alab_her.c.dec-cc.patch	Mon Feb  7 14:53:49 2000
+++ ./src/main/g_alab_her.c	Mon Feb  7 14:56:07 2000
@@ -18,12 +18,12 @@
 /* PAUL MURRELL
    sys-defines.h not used
 */
-// #include "sys-defines.h"
+/* #include "sys-defines.h" */
 
 /* PAUL MURRELL
    Added this to replace definition in sys-defines.h with R one
 */
-//#include "Mathlib.h"
+/* #include "Mathlib.h" */
 
 /* PAUL MURRELL
    extern.h renamed g_extern.h
@@ -166,7 +166,7 @@
   label_width = _label_width_hershey (dd, codestring);
 
   vmaxset(vmax);
-  //  free (codestring);
+  /*  free (codestring); */
   
   return label_width;
 }
@@ -281,9 +281,9 @@
 
   srtsave = dd->gp.srt;
   dd->gp.srt = rotation;
-  // dd->gp.lwd set in _draw_hershey_string
+  /* dd->gp.lwd set in _draw_hershey_string */
   lwdsave = dd->gp.lwd;
-  // When drawing vector font, always use "solid" lines
+  /* When drawing vector font, always use "solid" lines */
   ltysave = dd->gp.lty;
   dd->gp.lty = LTY_SOLID;
   
@@ -330,7 +330,7 @@
 		    GConvertYUnits(y_offset * label_height, g_unit, INCHES, dd));
     /* call stroker on the sequence of strokes obtained from each char (the
        stroker may manipulate the line width) */
-//_draw_hershey_stroke (dd, true, 0, HERSHEY_EM);      
+    /*_draw_hershey_stroke (dd, true, 0, HERSHEY_EM); */
       _draw_hershey_string (dd, codestring);
     
     /* Restore original values of relevant drawing attributes, free
@@ -348,7 +348,7 @@
     free (old_join_mode);
 */
     /* return to original position */
-//    _plotter->fmove (R___(_plotter) oldposx, oldposy);
+/*    _plotter->fmove (R___(_plotter) oldposx, oldposy); */
   }
 
   dd->gp.srt = srtsave;
@@ -368,12 +368,12 @@
 */
 
   vmaxset(vmax);
-  //  free (codestring);
+  /*  free (codestring); */
 
   /* PAUL MURRELL
      No return value 
   */
-  // return label_width;		/* user units */
+  /* return label_width; */		/* user units */
 }
 
 /* In addition to scaling the character sizes and the `width', we perform
@@ -708,15 +708,15 @@
 	    break;
 		
 	  case C_PUSH_LOCATION:
-	      // saved_charsize = charsize;
-	      // saved_position_x = _plotter->drawstate->pos.x;
-	      // saved_position_y = _plotter->drawstate->pos.y;
+	      /* saved_charsize = charsize;
+	         saved_position_x = _plotter->drawstate->pos.x;
+	         saved_position_y = _plotter->drawstate->pos.y; */
 	    break;
 		
 	  case C_POP_LOCATION:
-	      // charsize = saved_charsize;
-	      // _plotter->fmove (R___(_plotter)
-	      //	     saved_position_x, saved_position_y);
+	      /* charsize = saved_charsize;
+	         _plotter->fmove (R___(_plotter)
+	        	     saved_position_x, saved_position_y); */
 	    break;
 		
 	  case C_RIGHT_ONE_EM:
--- ./src/main/plot3d.c.dec-cc.patch	Mon Feb  7 14:57:15 2000
+++ ./src/main/plot3d.c	Mon Feb  7 14:58:58 2000
@@ -243,8 +243,8 @@
 	x = REAL(label)[i];
 	y = REAL(label)[i+4];
 	GConvert(&x, &y, USER, NDC, dd);
-	//	x = GConvertXUnits(REAL(label)[i], USER, NDC, dd);
-	//	y = GConvertYUnits(REAL(label)[i+4], USER, NDC, dd);
+	/*	x = GConvertXUnits(REAL(label)[i], USER, NDC, dd);
+	  	y = GConvertYUnits(REAL(label)[i+4], USER, NDC, dd); */
 	
 	if ((x < 0) || (x > 1) ||
 	    (y < 0) || (y > 1))
@@ -718,7 +718,7 @@
 	        sprintf(buffer, " %.00f ", zc);
 
 		if (vectorFonts) {
-		    // 1, 1 => sans serif, basic font
+		    /* 1, 1 => sans serif, basic font */
 		    labelDistance = GVStrWidth(buffer, typeface, fontindex,
 					       INCHES, dd);
 		    labelHeight = GVStrHeight(buffer, typeface, fontindex,
@@ -850,7 +850,7 @@
 			    if (lowestVariance < 9999999)
 				gotLabel = 1;
 			}
-		    } // switch (method) 
+		    } /* switch (method) */
 		    
 		    if (method == 0) {
 			GPolyline(ns, xxx, yyy, USER, dd);
@@ -871,7 +871,7 @@
 
 			if (gotLabel) {
 			    /* find which plot edge we are closest to */
-			    int closest; // 0 = index,  1 = index+range
+			    int closest; /* 0 = index,  1 = index+range */
 			    double dx1, dx2, dy1, dy2, dmin;
 			    dx1 = fmin2((xxx[index] - dd->gp.usr[0]),
 					(dd->gp.usr[1] - xxx[index]));
@@ -971,8 +971,8 @@
 				*/
 				GConvert(&ux, &uy, USER, INCHES, dd);
 				GConvert(&vx, &vy, USER, INCHES, dd);
-				// 1, 1 => sans serif, basic font
-				// 0, .5 => left, centre justified
+				/* 1, 1 => sans serif, basic font 
+				 * 0, .5 => left, centre justified */
 				if (vectorFonts) 
 				    GVText(ux, uy, INCHES, buffer, 
 					   typeface, fontindex,
@@ -986,9 +986,9 @@
 					  atan2(vy - uy, vx - ux), 
 					  dd);
 			    }
-			} // if (gotLabel)
-		    } // if (method == 0) else ...
-		} // if ((drawLabels == 1) && (labelDistance > 0))
+			} /* if (gotLabel) */
+		    } /* if (method == 0) else ... */
+		} /* if ((drawLabels == 1) && (labelDistance > 0)) */
 		else {
 		    GPolyline(ns, xxx, yyy, USER, dd);
 		}
@@ -1889,7 +1889,7 @@
 static void PerspAxis(double *x, double *y, double *z, int axis,
 		       int axisType, DevDesc *dd) {
     Vector3d u1, u2, u3, v1, v2, v3;
-    double tickLength = .03; // proportion of axis length
+    double tickLength = .03; /* proportion of axis length */
     double min, max, *range;
     double axp[3];
     int nint, i;



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._