[PPL-devel] [GIT] ppl/ppl(formatted_output): Some fixes.

Abramo Bagnara abramo.bagnara at gmail.com
Mon Mar 23 21:24:51 CET 2009


Module: ppl/ppl
Branch: formatted_output
Commit: d810281e8e849525c7e651152bedc21efe4b9a9b
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=d810281e8e849525c7e651152bedc21efe4b9a9b

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Mon Mar 23 21:23:30 2009 +0100

Some fixes.

---

 interfaces/C/tests/print_to_buffer.c |    8 ++------
 interfaces/C/tests/print_to_buffer.h |    4 ++--
 src/c_stream.h                       |   30 ++++++++++++++++--------------
 3 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/interfaces/C/tests/print_to_buffer.c b/interfaces/C/tests/print_to_buffer.c
index cafd0e5..5de5698 100644
--- a/interfaces/C/tests/print_to_buffer.c
+++ b/interfaces/C/tests/print_to_buffer.c
@@ -25,9 +25,9 @@ site: http://www.cs.unipr.it/ppl/ . */
 #include <malloc.h>
 #include <string.h>
 
-#define DEFINE_PRINT_TO_BUFFER(Type)                                    \
+#define DEFINE_PRINT_TO_BUFFER(Name)                                    \
 char*                                                                   \
-print_##Name##_to_buffer(##Type p,                                      \
+print_ppl_##Name##_t_to_buffer(ppl_const_##Name##_t p,			\
                          unsigned indent_depth,                         \
                          unsigned pfll,                                 \
                          unsigned pll) {                                \
@@ -71,9 +71,6 @@ print_##Name##_to_buffer(##Type p,                                      \
   return buf;								\
 }
 
-DEFINE_PRINT_TO_BUFFER(string, char);
-
-#if 0
 DEFINE_PRINT_TO_BUFFER(Coefficient)
 
 DEFINE_PRINT_TO_BUFFER(Linear_Expression)
@@ -95,4 +92,3 @@ DEFINE_PRINT_TO_BUFFER(Grid_Generator)
 DEFINE_PRINT_TO_BUFFER(Grid_Generator_System)
 
 DEFINE_PRINT_TO_BUFFER(MIP_Problem)
-#endif
diff --git a/interfaces/C/tests/print_to_buffer.h b/interfaces/C/tests/print_to_buffer.h
index 83e57f3..f565f94 100644
--- a/interfaces/C/tests/print_to_buffer.h
+++ b/interfaces/C/tests/print_to_buffer.h
@@ -33,9 +33,9 @@ site: http://www.cs.unipr.it/ppl/ . */
   `preferred_first_line_length' and `preferred_line_length',
   respectively.
 */
-#define DECLARE_PRINT_TO_BUFFER(Name, Type)                             \
+#define DECLARE_PRINT_TO_BUFFER(Name)					\
 char*                                                                   \
-print_##Name##_to_buffer(##Type p,                                      \
+print_ppl_##Name##_t_to_buffer(ppl_const_##Name##_t p,			\
                          unsigned indent_depth,                         \
                          unsigned preferred_first_line_length,          \
                          unsigned preferred_line_length);
diff --git a/src/c_stream.h b/src/c_stream.h
index 23ca3ff..e8857ee 100644
--- a/src/c_stream.h
+++ b/src/c_stream.h
@@ -46,33 +46,33 @@ enum ppl_io_format_line_type {
 #define PPL_IO_FORMAT_WRAP_POINTS 2
 
 struct ppl_io_format_settings {
-  // Char conversion table
+  /* Char conversion table */
   const char *tr_in;
   const char *tr_out;
-  // String for detect end of paragraph
+  /* String for detect end of paragraph */
   const char *paragraph_end;
-  // Lines can be wrapped on any of this characters
-  // If none from wrap_at[n] is found then wrap_at[n+1] is used.
+  /* Lines can be wrapped on any of this characters */
+  /* If none from wrap_at[n] is found then wrap_at[n+1] is used. */
   struct {
     const char *before;
     const char *after;
   } wrap_points[PPL_IO_FORMAT_WRAP_POINTS];
-  // Any of these characters are stripped at and after wrap point
+  /* Any of these characters are stripped at and after wrap point */
   const char *strip_wrap;
-  // This string is put at beginning of paragraph
+  /* This string is put at beginning of paragraph */
   const char *top;
-  // This string is put at end of paragraph
+  /* This string is put at end of paragraph */
   const char *bottom;
   struct {
-    // Length of line
+    /* Length of line */
     unsigned int length;
-    // Left margin string
+    /* Left margin string */
     const char *left;
-    // Right margin string
+    /* Right margin string */
     const char *right;
-    // 0 left, 8 center, 16 right
+    /* 0 left, 8 center, 16 right */
     unsigned int alignment;
-    // This char is used to fill line length
+    /* This char is used to fill line length */
     char fill_char;
   } lines[PPL_IO_FORMAT_LINE_END];
 };
@@ -90,8 +90,8 @@ void ppl_io_ostream_buffer_clear(struct ppl_io_ostream* stream);
 
 int ppl_io_write_endl(struct ppl_io_ostream* s);
 
-// FIXME:
-// Add ios_base methods: flags, setf, unsetf, width, precision (others?)
+/* FIXME: */
+/* Add ios_base methods: flags, setf, unsetf, width, precision (others?) */
 
 #define DECLARE_WRITE_VAL(name, type) int ppl_io_write_##name(struct ppl_io_ostream* s, const type o)
 #define DECLARE_WRITE_REF(name, type) int ppl_io_write_##name(struct ppl_io_ostream* s, const type* o)
@@ -105,8 +105,10 @@ DECLARE_WRITE_VAL(int, int);
 DECLARE_WRITE_VAL(unsigned_int, unsigned int);
 DECLARE_WRITE_VAL(long, long);
 DECLARE_WRITE_VAL(unsigned_long, unsigned long);
+/*
 DECLARE_WRITE_VAL(long_long, long long);
 DECLARE_WRITE_VAL(unsigned_long_long, unsigned long long);
+*/
 DECLARE_WRITE_VAL(float, float);
 DECLARE_WRITE_VAL(double, double);
 DECLARE_WRITE_VAL(long_double, long double);




More information about the PPL-devel mailing list