comparison src/ov-fcn-inline.cc @ 11586:12df7854fa7c

strip trailing whitespace from source files
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 17:24:59 -0500
parents fd0a3ac60b0e
children 7a5aacf65f81
comparison
equal deleted inserted replaced
11585:1473d0cf86d2 11586:12df7854fa7c
102 symbol_table::scope_id parent_scope 102 symbol_table::scope_id parent_scope
103 = curr_fcn->parent_fcn_scope (); 103 = curr_fcn->parent_fcn_scope ();
104 104
105 if (parent_scope < 0) 105 if (parent_scope < 0)
106 parent_scope = curr_fcn->scope (); 106 parent_scope = curr_fcn->scope ();
107 107
108 uf->stash_parent_fcn_scope (parent_scope); 108 uf->stash_parent_fcn_scope (parent_scope);
109 } 109 }
110 } 110 }
111 } 111 }
112 } 112 }
362 H5Tclose (type_hid); 362 H5Tclose (type_hid);
363 H5Gclose (group_hid); 363 H5Gclose (group_hid);
364 return false; 364 return false;
365 } 365 }
366 #if HAVE_HDF5_18 366 #if HAVE_HDF5_18
367 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid, 367 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid,
368 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); 368 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
369 #else 369 #else
370 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid, H5P_DEFAULT); 370 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid, H5P_DEFAULT);
371 #endif 371 #endif
372 if (data_hid < 0 || H5Dwrite (data_hid, type_hid, H5S_ALL, H5S_ALL, 372 if (data_hid < 0 || H5Dwrite (data_hid, type_hid, H5S_ALL, H5S_ALL,
671 { 671 {
672 bool is_arg = false; 672 bool is_arg = false;
673 bool in_string = false; 673 bool in_string = false;
674 std::string tmp_arg; 674 std::string tmp_arg;
675 size_t i = 0; 675 size_t i = 0;
676 676
677 while (i < fun.length ()) 677 while (i < fun.length ())
678 { 678 {
679 bool terminate_arg = false; 679 bool terminate_arg = false;
680 char c = fun[i++]; 680 char c = fun[i++];
681 681
698 else 698 else
699 { 699 {
700 // Before we do anything remove trailing whitespaces. 700 // Before we do anything remove trailing whitespaces.
701 while (i < fun.length () && isspace (c)) 701 while (i < fun.length () && isspace (c))
702 c = fun[i++]; 702 c = fun[i++];
703 703
704 // Do we have a variable or a function? 704 // Do we have a variable or a function?
705 if (c != '(') 705 if (c != '(')
706 terminate_arg = true; 706 terminate_arg = true;
707 else 707 else
708 { 708 {
717 } 717 }
718 718
719 if (terminate_arg || (i == fun.length () && is_arg)) 719 if (terminate_arg || (i == fun.length () && is_arg))
720 { 720 {
721 bool have_arg = false; 721 bool have_arg = false;
722 722
723 for (int j = 0; j < fargs.length (); j++) 723 for (int j = 0; j < fargs.length (); j++)
724 if (tmp_arg == fargs (j)) 724 if (tmp_arg == fargs (j))
725 { 725 {
726 have_arg = true; 726 have_arg = true;
727 break; 727 break;
728 } 728 }
729 729
730 if (! have_arg && tmp_arg != "i" && tmp_arg != "j" && 730 if (! have_arg && tmp_arg != "i" && tmp_arg != "j" &&
731 tmp_arg != "NaN" && tmp_arg != "nan" && 731 tmp_arg != "NaN" && tmp_arg != "nan" &&
732 tmp_arg != "Inf" && tmp_arg != "inf" && 732 tmp_arg != "Inf" && tmp_arg != "inf" &&
733 tmp_arg != "NA" && tmp_arg != "pi" && 733 tmp_arg != "NA" && tmp_arg != "pi" &&
734 tmp_arg != "eps") 734 tmp_arg != "eps")
735 fargs.append (tmp_arg); 735 fargs.append (tmp_arg);
736 736
737 tmp_arg = std::string (); 737 tmp_arg = std::string ();
931 } 931 }
932 932
933 if (func_is_string) 933 if (func_is_string)
934 retval = octave_value (new_func); 934 retval = octave_value (new_func);
935 else 935 else
936 retval = octave_value (new octave_fcn_inline 936 retval = octave_value (new octave_fcn_inline
937 (new_func, old->fcn_arg_names ())); 937 (new_func, old->fcn_arg_names ()));
938 } 938 }
939 } 939 }
940 else 940 else
941 print_usage (); 941 print_usage ();