comparison src/misc1.c @ 3461:27f6a22ff88e v7.3.495

updated for version 7.3.495 Problem: Compiler warnings. Solution: Add function declaration. Remove "offset" argument.
author Bram Moolenaar <bram@vim.org>
date Mon, 09 Apr 2012 20:42:26 +0200
parents bf5960ec2532
children 6c318419e331
comparison
equal deleted inserted replaced
3460:969cb7b3cd81 3461:27f6a22ff88e
4970 static int cin_isfuncdecl __ARGS((char_u **, linenr_T, linenr_T, int, int)); 4970 static int cin_isfuncdecl __ARGS((char_u **, linenr_T, linenr_T, int, int));
4971 static int cin_isif __ARGS((char_u *)); 4971 static int cin_isif __ARGS((char_u *));
4972 static int cin_iselse __ARGS((char_u *)); 4972 static int cin_iselse __ARGS((char_u *));
4973 static int cin_isdo __ARGS((char_u *)); 4973 static int cin_isdo __ARGS((char_u *));
4974 static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int)); 4974 static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
4975 static int cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset));
4975 static int cin_iswhileofdo_end __ARGS((int terminated, int ind_maxparen, int ind_maxcomment)); 4976 static int cin_iswhileofdo_end __ARGS((int terminated, int ind_maxparen, int ind_maxcomment));
4976 static int cin_isbreak __ARGS((char_u *)); 4977 static int cin_isbreak __ARGS((char_u *));
4977 static int cin_is_cpp_baseclass __ARGS((colnr_T *col)); 4978 static int cin_is_cpp_baseclass __ARGS((colnr_T *col));
4978 static int get_baseclass_amount __ARGS((int col, int ind_maxparen, int ind_maxcomment, int ind_cpp_baseclass)); 4979 static int get_baseclass_amount __ARGS((int col, int ind_maxparen, int ind_maxcomment, int ind_cpp_baseclass));
4979 static int cin_ends_in __ARGS((char_u *, char_u *, char_u *)); 4980 static int cin_ends_in __ARGS((char_u *, char_u *, char_u *));
5769 } 5770 }
5770 return retval; 5771 return retval;
5771 } 5772 }
5772 5773
5773 /* 5774 /*
5774 * Check whether in "p" there is an "if", "for" or "while" before offset. 5775 * Check whether in "p" there is an "if", "for" or "while" before "*poffset".
5775 * Return 0 if there is none. 5776 * Return 0 if there is none.
5776 * Otherwise return !0 and update "*poffset" to point to the place where the 5777 * Otherwise return !0 and update "*poffset" to point to the place where the
5777 * string was found. 5778 * string was found.
5778 */ 5779 */
5779 static int 5780 static int
5780 cin_is_if_for_while_before_offset(line, offset, poffset) 5781 cin_is_if_for_while_before_offset(line, poffset)
5781 char_u *line; 5782 char_u *line;
5782 size_t offset;
5783 int *poffset; 5783 int *poffset;
5784 { 5784 {
5785 int offset = *poffset;
5785 5786
5786 if (offset-- < 2) 5787 if (offset-- < 2)
5787 return 0; 5788 return 0;
5788 while (offset > 2 && vim_iswhite(line[offset])) 5789 while (offset > 2 && vim_iswhite(line[offset]))
5789 --offset; 5790 --offset;
5803 offset -= 2; 5804 offset -= 2;
5804 if (!STRNCMP(line + offset, "while", 5)) 5805 if (!STRNCMP(line + offset, "while", 5))
5805 goto probablyFound; 5806 goto probablyFound;
5806 } 5807 }
5807 } 5808 }
5808
5809 return 0; 5809 return 0;
5810
5810 probablyFound: 5811 probablyFound:
5811 if (!offset || !vim_isIDc(line[offset - 1])) 5812 if (!offset || !vim_isIDc(line[offset - 1]))
5812 { 5813 {
5813 *poffset = offset; 5814 *poffset = offset;
5814 return 1; 5815 return 1;
6888 curwin->w_cursor = cursor_save; 6889 curwin->w_cursor = cursor_save;
6889 6890
6890 line = ml_get(outermost.lnum); 6891 line = ml_get(outermost.lnum);
6891 6892
6892 is_if_for_while = 6893 is_if_for_while =
6893 cin_is_if_for_while_before_offset(line, outermost.col, 6894 cin_is_if_for_while_before_offset(line, &outermost.col);
6894 &outermost.col);
6895 } 6895 }
6896 6896
6897 amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment); 6897 amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment);
6898 look = skipwhite(look); 6898 look = skipwhite(look);
6899 if (*look == '(') 6899 if (*look == '(')