--- parser3/src/classes/image.C 2003/11/03 11:22:06 1.95 +++ parser3/src/classes/image.C 2003/11/20 17:07:43 1.100 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_IMAGE_C="$Date: 2003/11/03 11:22:06 $"; +static const char * const IDENT_IMAGE_C="$Date: 2003/11/20 17:07:43 $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -33,7 +33,7 @@ static const char* IDENT_IMAGE_C="$Date: class MImage: public Methoded { public: // VStateless_class - Value* create_new_value() { return new VImage(); } + Value* create_new_value(Pool&) { return new VImage(); } public: MImage(); @@ -687,8 +687,8 @@ struct File_measure_action_info { }; #endif static void file_measure_action( - struct stat& finfo, int f, - const String& file_spec, const char* fname, bool as_text, + struct stat& /*finfo*/, int f, + const String& /*file_spec*/, const char* fname, bool /*as_text*/, void *context) { File_measure_action_info& info=*static_cast(context); @@ -703,12 +703,12 @@ static void _measure(Request& r, MethodP ushort height=0; Value* exif=0; const String* file_name; - if(file_name=data.get_string()) { - File_measure_action_info info={0}; - info.width=&width; - info.height=&height; - info.exif=&exif; - info.file_name=file_name; + if((file_name=data.get_string())) { + File_measure_action_info info={ + &width, &height, + &exif, + file_name + }; file_read_action_under_lock(r.absolute(*file_name), "measure", file_measure_action, &info); } else { @@ -755,11 +755,10 @@ static void _html(Request& r, MethodPara if(params.count()) { // for backward compatibility: someday was ^html{} Value& vattribs=r.process_to_value(params[0], - /*0/*no name* /,*/ false/*don't intercept string*/); if(!vattribs.is_string()) // allow empty - if(attribs=vattribs.get_hash()) { - Attrib_info info={&tag}; + if((attribs=vattribs.get_hash())) { + Attrib_info info={&tag, 0}; attribs->for_each(append_attrib_pair, &info); } else throw Exception("parser.runtime", @@ -792,7 +791,6 @@ static gdImage* load(Request& r, throw Exception("file.missing", 0, "can not open '%s'", file_name_cstr); - return 0; } } @@ -805,7 +803,6 @@ static void _load(Request& r, MethodPara } static void _create(Request& r, MethodParams& params) { - int width=params.as_int(0, "width must be int", r); int height=params.as_int(1, "height must be int", r); int bgcolor_value=0xffFFff; @@ -818,7 +815,6 @@ static void _create(Request& r, MethodPa } static void _gif(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -842,7 +838,6 @@ static void _gif(Request& r, MethodParam } static void _line(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -858,7 +853,6 @@ static void _line(Request& r, MethodPara } static void _fill(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -872,7 +866,6 @@ static void _fill(Request& r, MethodPara } static void _rectangle(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -888,7 +881,6 @@ static void _rectangle(Request& r, Metho } static void _bar(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -912,7 +904,6 @@ static void add_point(Table::element_typ } #endif static void _replace(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -934,7 +925,6 @@ static void _replace(Request& r, MethodP } static void _polyline(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -956,7 +946,6 @@ static void _polyline(Request& r, Method } static void _polygon(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -977,7 +966,6 @@ static void _polygon(Request& r, MethodP } static void _polybar(Request& r, MethodParams& params) { - gdImage* image=GET_SELF(r, VImage).image; if(!image) throw Exception(0, @@ -1008,9 +996,9 @@ const int Font::letter_spacing=1; Font::Font(//, const String& aalphabet, gdImage* aifont, int aheight, int amonospace, int aspacebarspace): - alphabet(aalphabet), height(aheight), monospace(amonospace), spacebarspace(aspacebarspace), - ifont(aifont) { + ifont(aifont), + alphabet(aalphabet) { } /* ******************************** char ********************************** */