From 2dbf956bf301d759ea57cdc9235c99ad84c51aa7 Mon Sep 17 00:00:00 2001 From: vdhoeven Date: Tue, 19 Jan 2010 08:53:03 +0000 Subject: [PATCH] Fix Xcode warnings, part I git-svn-id: svn://svn.savannah.gnu.org/texmacs/trunk@2922 64cb5145-927a-446d-8aed-2fb7b4773692 --- src/src/Data/Convert/Tex/parsetex.cpp | 2 +- src/src/Data/History/commute.cpp | 1 + src/src/Data/Observers/ip_observer.cpp | 2 ++ src/src/Data/Observers/link.cpp | 1 + src/src/Data/Observers/tree_position.cpp | 1 + src/src/Data/String/converter.cpp | 2 +- src/src/Data/Tmfs/tmfs_permissions.cpp | 1 + src/src/Data/Tree/tree_cursor.cpp | 4 ++-- src/src/Graphics/Fonts/font.cpp | 4 ++-- src/src/Graphics/Renderer/printer.cpp | 1 + src/src/Kernel/Types/modification.cpp | 1 + src/src/Kernel/Types/string.cpp | 2 +- src/src/Kernel/Types/tree.cpp | 1 + src/src/Plugins/Cocoa/TMButtonsController.m | 2 +- src/src/Plugins/Freetype/unicode_font.cpp | 2 +- src/src/Plugins/MacOS/mac_app.mm | 1 + src/src/Plugins/MacOS/mac_spellservice.mm | 1 + src/src/Style/Environment/environment.hpp | 2 +- src/src/Style/Evaluate/evaluate_inactive.cpp | 2 ++ src/src/Style/Evaluate/evaluate_length.cpp | 4 ++-- src/src/System/Language/dictionary.cpp | 4 ++-- src/src/System/Link/connection.cpp | 1 + src/src/System/Link/pipe_link.cpp | 1 + src/src/System/Link/socket_link.cpp | 1 + src/src/System/Link/socket_server.cpp | 1 + src/src/Texmacs/Data/tm_data.cpp | 2 +- src/src/Texmacs/Texmacs/texmacs.cpp | 1 + src/src/Typeset/Boxes/Animate/animate_boxes.cpp | 4 ++++ src/src/Typeset/Boxes/Composite/decoration_boxes.cpp | 1 + src/src/Typeset/Boxes/Composite/superpose_boxes.cpp | 1 + src/src/Typeset/Bridge/bridge_hidden.cpp | 1 + src/src/Typeset/Env/env_inactive.cpp | 1 + src/src/Typeset/Env/env_length.cpp | 4 ++-- src/src/Typeset/Env/env_semantics.cpp | 4 ++-- src/src/Typeset/Format/formatter.cpp | 1 + src/src/Typeset/Graphics/curve.cpp | 4 +++- 36 files changed, 49 insertions(+), 20 deletions(-) diff --git a/src/src/Data/Convert/Tex/parsetex.cpp b/src/src/Data/Convert/Tex/parsetex.cpp index 2ffef53b..7318b6a6 100644 --- a/src/src/Data/Convert/Tex/parsetex.cpp +++ b/src/src/Data/Convert/Tex/parsetex.cpp @@ -148,7 +148,7 @@ latex_parser::parse (string s, int& i, string stop, bool change) { if (fr_cmd == "\\over") fr_cmd= "\\frac"; if (fr_cmd == "\\atop") fr_cmd= "\\ontop"; int j; - for (j=N(t); j>0 && is_regular (t[j-1]); j--); + for (j=N(t); j>0 && is_regular (t[j-1]); j--) {} tree num= t (j, N(t)); if (N(num) == 0) num= ""; t= t (0, j); diff --git a/src/src/Data/History/commute.cpp b/src/src/Data/History/commute.cpp index 49857e4b..f6d0e1c6 100644 --- a/src/src/Data/History/commute.cpp +++ b/src/src/Data/History/commute.cpp @@ -280,6 +280,7 @@ swap (modification& m1, modification& m2) { return r; } else return swap_basic (m1, m2); + FAILED ("unexpected situation"); } bool diff --git a/src/src/Data/Observers/ip_observer.cpp b/src/src/Data/Observers/ip_observer.cpp index 56173e74..4572cc68 100644 --- a/src/src/Data/Observers/ip_observer.cpp +++ b/src/src/Data/Observers/ip_observer.cpp @@ -58,6 +58,7 @@ has_parent (path ip) { void ip_observer_rep::announce (tree& ref, modification mod) { + (void) ref; //cout << "Announce " << ip << ", " << p << "\n"; if (!has_parent (ip)) return; tree& parent (subtree (the_et, reverse (ip->next))); @@ -66,6 +67,7 @@ ip_observer_rep::announce (tree& ref, modification mod) { void ip_observer_rep::done (tree& ref, modification mod) { + (void) ref; //cout << "Done " << ip << ", " << p << "\n"; if (!has_parent (ip)) return; tree& parent (subtree (the_et, reverse (ip->next))); diff --git a/src/src/Data/Observers/link.cpp b/src/src/Data/Observers/link.cpp index 61d59d10..5256fb9c 100644 --- a/src/src/Data/Observers/link.cpp +++ b/src/src/Data/Observers/link.cpp @@ -233,6 +233,7 @@ get_mirrors (tree ln, string id) { return list (); if (ln[2][0] == id) return not_done (get_trees (ln[3][0]->label)); if (ln[3][0] == id) return not_done (get_trees (ln[2][0]->label)); + return list (); } void diff --git a/src/src/Data/Observers/tree_position.cpp b/src/src/Data/Observers/tree_position.cpp index d8b07fc1..214cd023 100644 --- a/src/src/Data/Observers/tree_position.cpp +++ b/src/src/Data/Observers/tree_position.cpp @@ -169,6 +169,7 @@ tree_position_rep::notify_remove_node (tree& ref, int pos) { void tree_position_rep::notify_detach (tree& ref, tree closest, bool right) { + (void) ref; // cout << "Notify detach " << ref << ", " << closest <<", "<< right << "\n"; if (right) reattach_right (this, closest); else reattach_left (this, closest); diff --git a/src/src/Data/String/converter.cpp b/src/src/Data/String/converter.cpp index cc28c373..8b901c70 100644 --- a/src/src/Data/String/converter.cpp +++ b/src/src/Data/String/converter.cpp @@ -503,7 +503,7 @@ convert_char_entity (string s, int& start, bool& success) { string encode_as_utf8 (unsigned int code) { - if (0x0 <= code && code <= 0x7F) { + if (/* 0x0 <= code && */ code <= 0x7F) { // 0x0ddddddd return string((char) code); } diff --git a/src/src/Data/Tmfs/tmfs_permissions.cpp b/src/src/Data/Tmfs/tmfs_permissions.cpp index ed64a896..17c5a2f9 100644 --- a/src/src/Data/Tmfs/tmfs_permissions.cpp +++ b/src/src/Data/Tmfs/tmfs_permissions.cpp @@ -63,6 +63,7 @@ bool tmfs_allows (string id, string type, string user); bool tmfs_allows_via (string id, string type, string user, string via) { + (void) id; //cout << "Allows? " << id << ", " << type << ", " << user //<< " via " << via << LF; if (user == via) return true; diff --git a/src/src/Data/Tree/tree_cursor.cpp b/src/src/Data/Tree/tree_cursor.cpp index 7e354811..8a32fa34 100644 --- a/src/src/Data/Tree/tree_cursor.cpp +++ b/src/src/Data/Tree/tree_cursor.cpp @@ -26,7 +26,7 @@ is_inside (tree t, path p) { string s= t->label; int i, n= N(s), k= p->item; if (!is_atom (p) || k<0 || k>n) return false; - for (i=0; iitem == 0 || p->item == 1; @@ -42,7 +42,7 @@ closest_inside (tree t, path p) { else if (is_atomic (t)) { string s= t->label; int i, n= N(s), k= max (0, min (n, p->item)); - for (i=0; iitem < 0 || p->item >= N(t)) diff --git a/src/src/Graphics/Fonts/font.cpp b/src/src/Graphics/Fonts/font.cpp index 36744f12..4cdbe55c 100644 --- a/src/src/Graphics/Fonts/font.cpp +++ b/src/src/Graphics/Fonts/font.cpp @@ -85,7 +85,7 @@ font_rep::var_get_extents (string s, metric& ex) { int start=0, end; get_extents ("", ex); while (start x, array y, bool convex) { + (void) convex; int i, n= N(x); if ((N(y) != n) || (n<1)) return; print (x[0], y[0]); diff --git a/src/src/Kernel/Types/modification.cpp b/src/src/Kernel/Types/modification.cpp index 659170c5..df4d32a1 100644 --- a/src/src/Kernel/Types/modification.cpp +++ b/src/src/Kernel/Types/modification.cpp @@ -158,6 +158,7 @@ can_join (tree t, path p, int pos) { bool can_assign_node (tree t, path p, tree_label op) { + (void) op; return has_subtree (t, p) && is_compound (subtree (t, p)); } diff --git a/src/src/Kernel/Types/string.cpp b/src/src/Kernel/Types/string.cpp index 75f35a24..b3be8139 100644 --- a/src/src/Kernel/Types/string.cpp +++ b/src/src/Kernel/Types/string.cpp @@ -54,7 +54,7 @@ string::string (char c) { } string::string (const char* a) { - register int i, n=strlen(a); + int i, n=strlen(a); rep= tm_new (n); for (i=0; ia[i]=a[i]; diff --git a/src/src/Kernel/Types/tree.cpp b/src/src/Kernel/Types/tree.cpp index a346b46d..a0b6e15f 100644 --- a/src/src/Kernel/Types/tree.cpp +++ b/src/src/Kernel/Types/tree.cpp @@ -162,6 +162,7 @@ operator << (tm_ostream& out, tree t) { return out; } else out << as_blackbox (t); + return out; } void diff --git a/src/src/Plugins/Cocoa/TMButtonsController.m b/src/src/Plugins/Cocoa/TMButtonsController.m index 9d7843a0..439d9b10 100644 --- a/src/src/Plugins/Cocoa/TMButtonsController.m +++ b/src/src/Plugins/Cocoa/TMButtonsController.m @@ -124,7 +124,7 @@ r.origin.x = baseX; NSArray *arr = [barArray objectAtIndex:i]; float currHeight = 0.0; - for(j=0; j<[arr count]; j++) { + for(j=0; j<((int) [arr count]); j++) { NSSegmentedControl *sc = [arr objectAtIndex:j]; if (![sc superview]) [view addSubview:sc]; r.size = [sc frame].size; diff --git a/src/src/Plugins/Freetype/unicode_font.cpp b/src/src/Plugins/Freetype/unicode_font.cpp index 5dfeba9a..f658dc61 100644 --- a/src/src/Plugins/Freetype/unicode_font.cpp +++ b/src/src/Plugins/Freetype/unicode_font.cpp @@ -145,7 +145,7 @@ unicode_font_rep::get_extents (string s, metric& ex) { void unicode_font_rep::get_xpositions (string s, SI* xpos) { - register int i= 0, n= N(s); + int i= 0, n= N(s); if (n == 0) return; register SI x= 0; diff --git a/src/src/Plugins/MacOS/mac_app.mm b/src/src/Plugins/MacOS/mac_app.mm index e2772539..a5ab0ee0 100644 --- a/src/src/Plugins/MacOS/mac_app.mm +++ b/src/src/Plugins/MacOS/mac_app.mm @@ -30,6 +30,7 @@ from_nsstring (NSString *s) { @implementation TMAppDelegate - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { + (void) theApplication; call ("texmacs-load-buffer", object(url_system (from_nsstring(filename))), object("generic"), object(1), object(false)); } @end diff --git a/src/src/Plugins/MacOS/mac_spellservice.mm b/src/src/Plugins/MacOS/mac_spellservice.mm index f87e2659..3cc30855 100644 --- a/src/src/Plugins/MacOS/mac_spellservice.mm +++ b/src/src/Plugins/MacOS/mac_spellservice.mm @@ -168,6 +168,7 @@ mac_spell_insert (string lan, string s) { void mac_spell_done (string lan) { + (void) lan; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [[NSSpellChecker sharedSpellChecker] closeSpellDocumentWithTag:current_tag]; current_tag = 0; diff --git a/src/src/Style/Environment/environment.hpp b/src/src/Style/Environment/environment.hpp index 6d72e8ca..bf84ba48 100644 --- a/src/src/Style/Environment/environment.hpp +++ b/src/src/Style/Environment/environment.hpp @@ -62,7 +62,7 @@ public: return read ((int) make_tree_label (key)); } inline void write (const string& key, const tree& val) { write ((int) make_tree_label (key), val); } - inline bool remove (const string& key) { + inline void remove (const string& key) { remove ((int) make_tree_label (key)); } friend class environment; diff --git a/src/src/Style/Evaluate/evaluate_inactive.cpp b/src/src/Style/Evaluate/evaluate_inactive.cpp index 8985efd9..9d1f9228 100644 --- a/src/src/Style/Evaluate/evaluate_inactive.cpp +++ b/src/src/Style/Evaluate/evaluate_inactive.cpp @@ -232,6 +232,7 @@ rewrite_inactive_arg (tree t, int i, inactive_style sty) { tree rewrite_inactive_raw_data (tree t, inactive_style sty) { + (void) t; return rewrite_inactive_default (tree (RAW_DATA), sty); } @@ -295,6 +296,7 @@ rewrite_inactive_symbol (tree t, inactive_style sty) { tree rewrite_inactive_style_with (tree t, inactive_style sty, bool once) { + (void) once; int /*i,*/ n= N(t); tree recover= tuple (); /* diff --git a/src/src/Style/Evaluate/evaluate_length.cpp b/src/src/Style/Evaluate/evaluate_length.cpp index 9339ef43..825416b7 100644 --- a/src/src/Style/Evaluate/evaluate_length.cpp +++ b/src/src/Style/Evaluate/evaluate_length.cpp @@ -22,7 +22,7 @@ bool is_length (string s) { int i; - for (i=0; (i'z')); i++); + for (i=0; (i'z')); i++) {} return is_double (s (0, i)) && is_locase_alpha (s (i, N(s))); } @@ -88,7 +88,7 @@ as_tmlen (tree t) { string s= t->label; int start= 0, i, n=N(s); while ((start+1'z')); i++); + for (i=start; (i'z')); i++) {} string s1= s (start, i); string s2= s (i, n); if (!(is_double (s1) && is_locase_alpha (s2))) return tree (TMLEN, "0"); diff --git a/src/src/System/Language/dictionary.cpp b/src/src/System/Language/dictionary.cpp index 623b5c9b..6164b99b 100644 --- a/src/src/System/Language/dictionary.cpp +++ b/src/src/System/Language/dictionary.cpp @@ -91,10 +91,10 @@ dictionary_rep::translate (string s) { for (i=0; i0) return s (0, i) * translate (s (i, n)); - for (i=n; i>0 && s[i-1]==' '; i--); + for (i=n; i>0 && s[i-1]==' '; i--) {} if (ilisten (); diff --git a/src/src/System/Link/pipe_link.cpp b/src/src/System/Link/pipe_link.cpp index 8ae7ec9b..e45ed7ad 100644 --- a/src/src/System/Link/pipe_link.cpp +++ b/src/src/System/Link/pipe_link.cpp @@ -327,6 +327,7 @@ pipe_link_rep::stop () { void pipe_callback (void *obj, void *info) { #ifndef __MINGW32__ + (void) info; pipe_link_rep* con= (pipe_link_rep*) obj; bool busy= true; bool news= false; diff --git a/src/src/System/Link/socket_link.cpp b/src/src/System/Link/socket_link.cpp index 418ddec5..ad5451a5 100644 --- a/src/src/System/Link/socket_link.cpp +++ b/src/src/System/Link/socket_link.cpp @@ -247,6 +247,7 @@ socket_link_rep::stop () { void socket_callback (void *obj, void* info) { #ifndef __MINGW32__ + (void) info; socket_link_rep* con= (socket_link_rep*) obj; bool busy= true; bool news= false; diff --git a/src/src/System/Link/socket_server.cpp b/src/src/System/Link/socket_server.cpp index a7090607..163a3891 100644 --- a/src/src/System/Link/socket_server.cpp +++ b/src/src/System/Link/socket_server.cpp @@ -175,6 +175,7 @@ socket_server_rep::stop () { void socket_server_callback (void *obj, void *info) { #ifndef __MINGW32__ + (void) info; socket_server_rep* ss = (socket_server_rep*) obj; bool busy= true; bool news= false; diff --git a/src/src/Texmacs/Data/tm_data.cpp b/src/src/Texmacs/Data/tm_data.cpp index cae7db87..0cd459c1 100644 --- a/src/src/Texmacs/Data/tm_data.cpp +++ b/src/src/Texmacs/Data/tm_data.cpp @@ -405,7 +405,7 @@ tm_data_rep::delete_view_from_window (tm_window win) { void tm_data_rep::delete_window (tm_window win) { - while (delete_view_from_window (win)); + while (delete_view_from_window (win)) {} win->unmap (); destroy_window_widget (win->win); tm_delete (win); diff --git a/src/src/Texmacs/Texmacs/texmacs.cpp b/src/src/Texmacs/Texmacs/texmacs.cpp index fa1693fc..a872c3f8 100644 --- a/src/src/Texmacs/Texmacs/texmacs.cpp +++ b/src/src/Texmacs/Texmacs/texmacs.cpp @@ -68,6 +68,7 @@ test_routines () { void TeXmacs_init_paths (int& argc, char** argv) { + (void) argc; (void) argv; #ifdef QTTEXMACS url exedir = url_system (qt_application_directory ()); #else diff --git a/src/src/Typeset/Boxes/Animate/animate_boxes.cpp b/src/src/Typeset/Boxes/Animate/animate_boxes.cpp index 884a48f0..5faa4905 100644 --- a/src/src/Typeset/Boxes/Animate/animate_boxes.cpp +++ b/src/src/Typeset/Boxes/Animate/animate_boxes.cpp @@ -69,6 +69,7 @@ anim_constant_box_rep::anim_constant_box_rep (path ip, box b, int length2): void anim_constant_box_rep::pre_display (renderer& ren) { + (void) ren; if (!started) anim_start_at (texmacs_time ()); else if (!finished) { finished= (texmacs_time () - (started_at+length) >= 0); @@ -208,6 +209,7 @@ anim_compose_box_rep::find_tag (string name) { void anim_compose_box_rep::pre_display (renderer& ren) { + (void) ren; if (!started) anim_start_at (texmacs_time ()); else if (!finished) { time_t now= texmacs_time (); @@ -329,6 +331,7 @@ anim_repeat_box_rep::anim_repeat_box_rep (path ip, box b): void anim_repeat_box_rep::pre_display (renderer& ren) { + (void) ren; if (!started) anim_start_at (texmacs_time ()); else if (length > 0) { time_t now= texmacs_time (); @@ -507,6 +510,7 @@ struct sound_box_rep: public box_rep { system ("play", u, "&"); started= true; } void pre_display (renderer& ren) { + (void) ren; if (!started) anim_start_at (texmacs_time ()); } int anim_length () { return 0; } bool anim_started () { return started; } diff --git a/src/src/Typeset/Boxes/Composite/decoration_boxes.cpp b/src/src/Typeset/Boxes/Composite/decoration_boxes.cpp index 57f8edc6..dd274bac 100644 --- a/src/src/Typeset/Boxes/Composite/decoration_boxes.cpp +++ b/src/src/Typeset/Boxes/Composite/decoration_boxes.cpp @@ -122,6 +122,7 @@ struct scrollbar_box_rep: public composite_box_rep { tree scrollbar_box_rep::action (tree type, SI x, SI y, SI delta) { + (void) type; (void) delta; tree u= t; if (vertical) { double p= 100.0; diff --git a/src/src/Typeset/Boxes/Composite/superpose_boxes.cpp b/src/src/Typeset/Boxes/Composite/superpose_boxes.cpp index a8db7063..07d4a9a1 100644 --- a/src/src/Typeset/Boxes/Composite/superpose_boxes.cpp +++ b/src/src/Typeset/Boxes/Composite/superpose_boxes.cpp @@ -33,6 +33,7 @@ superpose_box_rep::operator tree () { int superpose_box_rep::reindex (int i, int item, int n) { + (void) item; (void) n; return i; } diff --git a/src/src/Typeset/Bridge/bridge_hidden.cpp b/src/src/Typeset/Bridge/bridge_hidden.cpp index 9b1b6e2a..9f0fcded 100644 --- a/src/src/Typeset/Bridge/bridge_hidden.cpp +++ b/src/src/Typeset/Bridge/bridge_hidden.cpp @@ -66,6 +66,7 @@ bridge_hidden_rep::notify_change () { void bridge_hidden_rep::my_typeset (int desired_status) { + (void) desired_status; stack_border temp_sb; array temp_l= typeset_stack (env, st, ip, ttt->a, ttt->b, temp_sb); diff --git a/src/src/Typeset/Env/env_inactive.cpp b/src/src/Typeset/Env/env_inactive.cpp index 9cba93ab..ef748a57 100644 --- a/src/src/Typeset/Env/env_inactive.cpp +++ b/src/src/Typeset/Env/env_inactive.cpp @@ -235,6 +235,7 @@ tree edit_env_rep::rewrite_inactive_raw_data ( tree t, tree var, bool block, bool flush) { + (void) t; (void) block; return rewrite_inactive_default (tree (RAW_DATA), var, block, flush); } diff --git a/src/src/Typeset/Env/env_length.cpp b/src/src/Typeset/Env/env_length.cpp index 2017fd4e..d53dd696 100644 --- a/src/src/Typeset/Env/env_length.cpp +++ b/src/src/Typeset/Env/env_length.cpp @@ -21,7 +21,7 @@ bool edit_env_rep::is_length (string s) { int i; - for (i=0; (i'z')); i++); + for (i=0; (i'z')); i++) {} return is_double (s (0, i)) && is_locase_alpha (s (i, N(s))); } @@ -123,7 +123,7 @@ edit_env_rep::as_tmlen (tree t) { string s= t->label; int start= 0, i, n=N(s); while ((start+1'z')); i++); + for (i=start; (i'z')); i++) {} string s1= s (start, i); string s2= s (i, n); if (!(is_double (s1) && is_locase_alpha (s2))) return tree (TMLEN, "0"); diff --git a/src/src/Typeset/Env/env_semantics.cpp b/src/src/Typeset/Env/env_semantics.cpp index 0af4a9c3..0540d2b0 100644 --- a/src/src/Typeset/Env/env_semantics.cpp +++ b/src/src/Typeset/Env/env_semantics.cpp @@ -399,7 +399,7 @@ edit_env_rep::update_dash_style () { dash_style= array(0); if (is_string (t)) { string s= as_string (t); - if (s == "none") ; + if (s == "none") {} } else if (is_tuple (t)) { @@ -428,7 +428,7 @@ edit_env_rep::update_line_arrows () { line_arrows= array(2); if (is_string (t)) { string s= as_string (t); - if (s == "none") ; + if (s == "none") {} } else if (is_tuple (t) && N(t)<=2 && N(t)>0) { diff --git a/src/src/Typeset/Format/formatter.cpp b/src/src/Typeset/Format/formatter.cpp index a162bae9..bde572eb 100644 --- a/src/src/Typeset/Format/formatter.cpp +++ b/src/src/Typeset/Format/formatter.cpp @@ -81,6 +81,7 @@ lazy_rep::produce (lazy_type request, format fm) { format lazy_rep::query (lazy_type request, format fm) { + (void) request; cout << "\nThe lazy structure was " << ((tree) (*this)) << "\n"; cout << "The format was " << ((tree) fm) << "\n"; FAILED ("invalid query"); diff --git a/src/src/Typeset/Graphics/curve.cpp b/src/src/Typeset/Graphics/curve.cpp index f96a7659..897a3cfd 100644 --- a/src/src/Typeset/Graphics/curve.cpp +++ b/src/src/Typeset/Graphics/curve.cpp @@ -205,15 +205,17 @@ struct segment_rep: public curve_rep { path cip1, cip2; segment_rep (point p1b, point p2b): p1 (p1b), p2 (p2b) {} point evaluate (double t) { return (1.0-t)*p1 + t*p2; } - void rectify_cumul (array& a, double eps) { a << p2; } + void rectify_cumul (array& a, double eps) { (void) eps; a << p2; } double bound (double t, double eps) { return curve_rep::bound (t, eps); } point grad (double t, bool& error) { + (void) t; error= false; return p2 - p1; } double curvature (double t1, double t2) { + (void) t1; (void) t2; return tm_infinity; } int get_control_points ( -- 2.11.4.GIT