Added my "Copyright (c) 2007" notices, for files I edited in 2007.
[synfig.git] / synfig-core / trunk / src / modules / mod_mng / trgt_mng.cpp
index 8b44ad5..05b127f 100644 (file)
@@ -5,7 +5,8 @@
 **     $Id$
 **
 **     \legal
-**     Copyright 2007 Paul Wise
+**     Copyright (c) 2007 Paul Wise
+**     Copyright (c) 2007 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -68,13 +69,13 @@ mng_alloc_proc(mng_size_t size)
 }
 
 static void MNG_DECL
-mng_free_proc(mng_ptr ptr, mng_size_t size)
+mng_free_proc(mng_ptr ptr, mng_size_t size __attribute__ ((unused)))
 {
        free(ptr); return;
 }
 
 static mng_bool MNG_DECL
-mng_null_proc(mng_handle mng)
+mng_null_proc(mng_handle mng __attribute__ ((unused)))
 {
        // synfig::info("%s:%d mng_trgt::mng_null_proc was called", __FILE__, __LINE__);
        return MNG_TRUE;
@@ -89,8 +90,10 @@ mng_write_proc(mng_handle mng, mng_ptr buf, mng_uint32 size, mng_uint32* written
 }
 
 static mng_bool MNG_DECL
-mng_error_proc(mng_handle mng, mng_int32 error, mng_int8 severity, mng_chunkid chunkname,
-                          mng_uint32 chunkseq, mng_int32 extra1, mng_int32 extra2, mng_pchar errortext)
+mng_error_proc(mng_handle mng __attribute__ ((unused)), mng_int32 error __attribute__ ((unused)),
+                          mng_int8 severity __attribute__ ((unused)), mng_chunkid chunkname __attribute__ ((unused)),
+                          mng_uint32 chunkseq __attribute__ ((unused)), mng_int32 extra1 __attribute__ ((unused)),
+                          mng_int32 extra2 __attribute__ ((unused)), mng_pchar errortext)
 {
        synfig::error("%s:%d mng_trgt: error: %s", __FILE__, __LINE__, errortext);
        return MNG_TRUE;
@@ -180,10 +183,23 @@ mng_trgt::init()
        if (mng_create(mng) != 0) goto cleanup_on_error;
        if (mng_putchunk_mhdr(mng, w, h, frame_rate, num_layers, num_frames, play_time, MNG_SIMPLICITY_VALID|MNG_SIMPLICITY_SIMPLEFEATURES) != 0) goto cleanup_on_error;
        if (mng_putchunk_term(mng, MNG_TERMACTION_REPEAT, MNG_ITERACTION_LASTFRAME, 0, 0x7fffffff) != 0) goto cleanup_on_error;
-       if (mng_putchunk_text(mng, sizeof(MNG_TEXT_TITLE), MNG_TEXT_TITLE, get_canvas()->get_name().length(), const_cast<char *>(get_canvas()->get_name().c_str())) != 0) goto cleanup_on_error;
-       if (mng_putchunk_text(mng, sizeof(MNG_TEXT_DESCRIPTION), MNG_TEXT_DESCRIPTION, get_canvas()->get_description().length(), const_cast<char *>(get_canvas()->get_description().c_str())) != 0) goto cleanup_on_error;
-       if (mng_putchunk_text(mng, sizeof(MNG_TEXT_SOFTWARE), MNG_TEXT_SOFTWARE, sizeof("SYNFIG"), "SYNFIG") != 0) goto cleanup_on_error;
-       if (mng_putchunk_gama(mng, MNG_FALSE, (int)(1.0/gamma().get_gamma()*100000)) != 0) goto cleanup_on_error;
+       {
+               char title[] = MNG_TEXT_TITLE;
+               if (mng_putchunk_text(mng, sizeof(title), title,
+                                                         get_canvas()->get_name().length(), const_cast<char *>(get_canvas()->get_name().c_str())) != 0)
+                       goto cleanup_on_error;
+
+               char description[] = MNG_TEXT_DESCRIPTION;
+               if (mng_putchunk_text(mng, sizeof(description), description,
+                                                         get_canvas()->get_description().length(), const_cast<char *>(get_canvas()->get_description().c_str())) != 0)
+                       goto cleanup_on_error;
+
+               char software[] = MNG_TEXT_SOFTWARE; char synfig[] = "SYNFIG";
+               if (mng_putchunk_text(mng, sizeof(software), software,
+                                                         sizeof(synfig), synfig) != 0)
+                       goto cleanup_on_error;
+       }
+       if (mng_putchunk_gama(mng, MNG_FALSE, (int)(gamma().get_gamma()*100000)) != 0) goto cleanup_on_error;
        if (mng_putchunk_phys(mng, MNG_FALSE, round_to_int(desc.get_x_res()),round_to_int(desc.get_y_res()), MNG_UNIT_METER) != 0) goto cleanup_on_error;
        if (mng_putchunk_time(mng, gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday, gmt->tm_hour, gmt->tm_min, gmt->tm_sec) != 0) goto cleanup_on_error;
        buffer=new unsigned char[(4*w)+1];
@@ -251,7 +267,7 @@ mng_trgt::end_frame()
 }
 
 bool
-mng_trgt::start_frame(synfig::ProgressCallback *callback)
+mng_trgt::start_frame(synfig::ProgressCallback *callback __attribute__ ((unused)))
 {
        // synfig::info("%s:%d mng_trgt::start_frame()", __FILE__, __LINE__); 
 
@@ -292,7 +308,7 @@ mng_trgt::start_frame(synfig::ProgressCallback *callback)
 }
 
 Color*
-mng_trgt::start_scanline(int scanline)
+mng_trgt::start_scanline(int scanline __attribute__ ((unused)))
 {
        return color_buffer;
 }