Commit 93875fca authored by Jim Nelson's avatar Jim Nelson

#2371: valac 0.9.5 knows that error() will not return and so no need to...

#2371: valac 0.9.5 knows that error() will not return and so no need to provide fake return values for code correctness.  This patch makes Shotwell unable to compile with earlier compilers.
parent 2ba0e6ae
......@@ -5,7 +5,7 @@ GETTEXT_PACKAGE = $(PROGRAM)
BUILD_ROOT = 1
VALAC = valac
MIN_VALAC_VERSION = 0.8.0
MIN_VALAC_VERSION = 0.9.5
INSTALL_PROGRAM = install
INSTALL_DATA = install -m 644
......
......@@ -998,7 +998,6 @@ public class CheckerboardLayout : Gtk.DrawingArea {
default:
error("Bad compass point %d", (int) point);
break;
}
CheckerboardItem? new_item = get_item_at_coordinate(col, row);
......
......@@ -1728,8 +1728,6 @@ public abstract class CollectionPage : CheckerboardPage {
default:
error("Unknown sort criteria: %s", get_sort_criteria().to_string());
return Thumbnail.title_ascending_comparator;
}
}
......@@ -1746,8 +1744,6 @@ public abstract class CollectionPage : CheckerboardPage {
default:
error("Unknown sort criteria: %s", get_sort_criteria().to_string());
return Thumbnail.title_comparator_predicate;
}
}
......@@ -1798,7 +1794,6 @@ public abstract class CollectionPage : CheckerboardPage {
break;
default:
error("Unknown sort criteria: %d", sort_by);
break;
}
return path;
......
......@@ -193,7 +193,6 @@ public struct HSVAnalyticPixel {
default:
error("bad color hexant in HSV-to-RGB conversion");
break;
}
}
......
......@@ -1276,8 +1276,6 @@ public class PhotoTable : DatabaseTable {
return map;
} catch (Error err) {
error("%s", err.message);
return null;
}
}
......@@ -1330,8 +1328,6 @@ public class PhotoTable : DatabaseTable {
assert(trans.length > 0);
} catch (Error err) {
error("%s", err.message);
return false;
}
return set_raw_transformations(photo_id, trans);
......@@ -1357,8 +1353,6 @@ public class PhotoTable : DatabaseTable {
assert(trans != null);
} catch (Error err) {
error("%s", err.message);
return false;
}
return set_raw_transformations(photo_id, trans);
......
......@@ -231,11 +231,10 @@ public struct Dimensions {
case ScaleConstraint.HEIGHT:
return get_scaled_by_height(scale);
default:
error("Bad constraint: %d", (int) constraint);
}
error("Bad constraint: %d", (int) constraint);
return Dimensions();
}
}
......
......@@ -2603,7 +2603,6 @@ public class AdjustTool : EditingTool {
default:
error("Unknown adjustment: %d", (int) transformation.get_transformation_type());
break;
}
}
......
......@@ -537,8 +537,6 @@ public class ImportPage : CheckerboardPage {
public override CheckerboardItem? get_fullscreen_photo() {
error("No fullscreen support for import pages");
return null;
}
public override void switched_to() {
......@@ -620,7 +618,6 @@ public class ImportPage : CheckerboardPage {
default:
error("Unknown result type %d", (int) res);
break;
}
}
......
......@@ -105,8 +105,6 @@ public class MimicManager : Object {
writer = MIMIC_FILE_FORMAT.create_writer(generate_impersonator_filepath(photo));
} catch (PhotoFormatError err) {
error("Unable to create PhotoFileWriter for impersonator: %s", err.message);
continue;
}
VerifyJob job = new VerifyJob(this, photo, writer);
......
......@@ -73,11 +73,8 @@ public enum Orientation {
case LEFT_BOTTOM:
return TOP_LEFT;
default: {
default:
error("rotate_clockwise: %d", this);
return this;
}
}
}
......@@ -107,11 +104,8 @@ public enum Orientation {
case LEFT_BOTTOM:
return BOTTOM_RIGHT;
default: {
default:
error("rotate_counterclockwise: %d", this);
return this;
}
}
}
......@@ -141,11 +135,8 @@ public enum Orientation {
case LEFT_BOTTOM:
return LEFT_TOP;
default: {
default:
error("flip_top_to_bottom: %d", this);
return this;
}
}
}
......@@ -175,11 +166,8 @@ public enum Orientation {
case LEFT_BOTTOM:
return RIGHT_BOTTOM;
default: {
default:
error("flip_left_to_right: %d", this);
return this;
}
}
}
......@@ -199,8 +187,6 @@ public enum Orientation {
default:
error("perform: %d", (int) rotation);
return this;
}
}
......@@ -234,8 +220,6 @@ public enum Orientation {
default:
error("to_rotations: %d", this);
return { };
}
}
......@@ -257,8 +241,6 @@ public enum Orientation {
default:
error("rotate_dimensions: %d", this);
return dim;
}
}
......@@ -306,7 +288,6 @@ public enum Orientation {
default:
error("rotate_pixbuf: %d", this);
break;
}
return pixbuf;
......@@ -372,7 +353,6 @@ public enum Orientation {
default:
error("rotate_point: %d", this);
break;
}
return rotated;
......@@ -434,7 +414,6 @@ public enum Orientation {
default:
error("rotate_point: %d", this);
break;
}
return derotated;
......@@ -485,8 +464,6 @@ public enum Rotation {
default:
error("Unknown rotation: %d", (int) this);
return pixbuf;
}
}
......@@ -504,8 +481,6 @@ public enum Rotation {
default:
error("Unknown rotation: %d", (int) this);
return this;
}
}
}
......
......@@ -514,8 +514,6 @@ public abstract class TransformablePhoto: PhotoSource {
default:
error("Unknown backing fetch mode %s", mode.to_string());
return get_baseline_reader();
}
}
......
......@@ -134,8 +134,6 @@ public enum PhotoFileFormat {
default:
error("Unsupported file format %s", this.to_string());
return JfifFileFormatDriver.get_instance();
}
}
......
......@@ -194,7 +194,6 @@ public class PixbufCache : Object {
default:
error("Unknown photo type: %d", (int) type);
break;
}
in_progress.set(photo, job);
......
......@@ -64,9 +64,7 @@ public struct PrintSettings {
default:
error("unknown ContentLayout enumeration value");
break;
}
return Measurement(0, MeasurementUnit.INCHES);
}
public Measurement get_content_height() {
......@@ -81,9 +79,7 @@ public struct PrintSettings {
default:
error("unknown ContentLayout enumeration value");
break;
}
return Measurement(0, MeasurementUnit.INCHES);
}
public Measurement get_minimum_content_dimension() {
......@@ -170,7 +166,6 @@ public struct Measurement {
return Measurement(value * CENTIMETERS_PER_INCH, MeasurementUnit.CENTIMETERS);
} else {
error("unrecognized unit");
return Measurement(0, MeasurementUnit.INCHES);
}
}
......@@ -476,7 +471,6 @@ public class CustomPrintTab : Gtk.Fixed {
return MeasurementUnit.CENTIMETERS;
} else {
error("unknown unit combo box choice");
return MeasurementUnit.INCHES;
}
}
......@@ -596,7 +590,6 @@ public class CustomPrintTab : Gtk.Fixed {
default:
error("unknown ContentLayout enumeration value");
break;
}
}
......@@ -625,7 +618,6 @@ public class CustomPrintTab : Gtk.Fixed {
default:
error("unknown ContentLayout enumeration value");
break;
}
}
......@@ -638,7 +630,6 @@ public class CustomPrintTab : Gtk.Fixed {
return ContentLayout.FILL_PAGE;
error("inconsistent content layout radio button group state");
return ContentLayout.FILL_PAGE;
}
private void set_content_width(Measurement content_width) {
......@@ -887,7 +878,6 @@ public class PrintManager {
default:
error("unknown or unsupported layout mode");
break;
}
}
......@@ -945,8 +935,6 @@ public class PrintManager {
true);
} catch (Error e) {
error(_("Unable to print photo:\n\n%s").printf(e.message));
job.cancel();
return;
}
Gdk.cairo_set_source_pixbuf(dc, photo_pixbuf, 0.0, 0.0);
}
......@@ -984,8 +972,6 @@ public class PrintManager {
photo_pixbuf = job.get_source_photo().get_pixbuf(Scaling.for_original());
} catch (Error e) {
error(_("Unable to print photo:\n\n%s").printf(e.message));
job.cancel();
return;
}
/* if the original photo's aspect ratio differs significantly from the aspect ratio
......
......@@ -218,8 +218,6 @@ public class ThumbnailCache : Object {
default:
error("Unknown thumbnail size %d", size.get_scale());
return medium;
}
}
......
......@@ -32,7 +32,6 @@ public enum HttpMethod {
default:
error("unrecognized HTTP method enumeration value");
return "";
}
}
......@@ -45,7 +44,6 @@ public enum HttpMethod {
return HttpMethod.POST;
} else {
error("unrecognized HTTP method name: %s", str);
return HttpMethod.GET;
}
}
}
......@@ -1083,7 +1081,6 @@ public class ServiceFactory {
return new PicasaConnector.Interactor(host);
} else {
error("ServiceInteractor: unsupported service '%s'", service_name);
return null;
}
}
}
......
......@@ -59,7 +59,6 @@ public abstract class AbstractSemaphore {
default:
error("Unknown semaphore action: %s", action.to_string());
break;
}
mutex.unlock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment