Skip to content

Commit

Permalink
Made changes to Log.hx and File.hx to compile with Haxe3
Browse files Browse the repository at this point in the history
Basic changes

 * Switch on enums use only 'value', not 'Enum.value'

Then I ran "./build.sh" and all other changes were a result of that.
  • Loading branch information
jasononeil committed Dec 25, 2012
1 parent d526a59 commit 3b903d2
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 130 deletions.
37 changes: 4 additions & 33 deletions haxe/src/massive/haxe/AllClasses.hx
Original file line number Diff line number Diff line change
@@ -1,41 +1,12 @@
/****
* Copyright 2012 Massive Interactive. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY MASSIVE INTERACTIVE "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MASSIVE INTERACTIVE OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of Massive Interactive.
*
****/

package massive.haxe;

import massive.haxe.util.RegExpUtil;
import massive.haxe.util.TemplateUtil;
import massive.haxe.util.ReflectUtil;
import massive.haxe.Exception;
import massive.haxe.log.ILogClient;
import massive.haxe.log.Log;
import massive.haxe.log.ILogClient;
import massive.haxe.log.LogClient;
import massive.haxe.util.ReflectUtil;
import massive.haxe.util.RegExpUtil;
import massive.haxe.util.TemplateUtil;

@IgnoreCover
class AllClasses
Expand Down
34 changes: 18 additions & 16 deletions haxe/src/massive/haxe/log/Log.hx
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,32 @@ class Log

public static function convertLogLevelToInt(type:LogLevel):Int
{
return switch(type)
var r = switch(type)
{
case LogLevel.all:0;
case LogLevel.debug:1;
case LogLevel.info:2;
case LogLevel.warn:3;
case LogLevel.error:4;
case LogLevel.fatal:5;
case LogLevel.console:100;
case all:0;
case debug:1;
case info:2;
case warn:3;
case error:4;
case fatal:5;
case console:100;
}
return r;
}

public static function convertLogLevelToString(type:LogLevel):String
{
return switch(type)
var r = switch(type)
{
case LogLevel.all:"all";
case LogLevel.debug:"debug";
case LogLevel.info:"info";
case LogLevel.warn:"warn";
case LogLevel.error:"error";
case LogLevel.fatal:"fatal";
case LogLevel.console:"";
case all:"all";
case debug:"debug";
case info:"info";
case warn:"warn";
case error:"error";
case fatal:"fatal";
case console:"";
}
return r;
}

public static function setLogLevelFromString(type:String):Void
Expand Down
Binary file modified mlib.n
Binary file not shown.
43 changes: 7 additions & 36 deletions neko/src/massive/neko/AllClasses.hx
Original file line number Diff line number Diff line change
@@ -1,46 +1,17 @@
/****
* Copyright 2012 Massive Interactive. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY MASSIVE INTERACTIVE "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MASSIVE INTERACTIVE OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of Massive Interactive.
*
****/

package massive.neko;

import massive.neko.cmd.Command;
import massive.neko.util.ZipUtil;
import massive.neko.util.PathUtil;
import massive.neko.io.File;
import massive.neko.io.FileException;
import massive.neko.io.FileSys;
import massive.neko.cmd.ICommand;
import massive.neko.cmd.CommandLineRunner;
import massive.neko.cmd.Command;
import massive.neko.cmd.Console;
import massive.neko.cmd.ICommand;
import massive.neko.haxe.HaxeWrapper;
import massive.neko.haxelib.Haxelib;
import massive.neko.haxelib.HaxelibTools;
import massive.neko.io.File;
import massive.neko.io.FileException;
import massive.neko.io.FileSys;
import massive.neko.util.PathUtil;
import massive.neko.util.ZipUtil;

@IgnoreCover
class AllClasses
Expand Down
21 changes: 11 additions & 10 deletions neko/src/massive/neko/io/File.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1003,9 +1003,9 @@ class File
{
switch(type)
{
case FileType.DIRECTORY: return path.dir.split(seperator).pop();
case FileType.FILE: return path.file;
case FileType.UNKNOWN: return path.toString().split(seperator).pop();
case DIRECTORY: return path.dir.split(seperator).pop();
case FILE: return path.file;
case UNKNOWN: return path.toString().split(seperator).pop();
}

return null;
Expand All @@ -1014,23 +1014,24 @@ class File

private function get_fileName():String
{
switch(type)
var r = switch(type)
{
case FileType.DIRECTORY: return null;
case FileType.FILE: return name + (extension != null ? "." + extension : "");
case FileType.UNKNOWN: return name;
case DIRECTORY: null;
case FILE: name + (extension != null ? "." + extension : "");
case UNKNOWN: name;
}
return r;
}


private function get_extension():String
{
switch(type)
var r = switch(type)
{

case FileType.FILE: return path.ext;
case FILE: return path.ext;
default: return null;
}
return r;
}

private function get_nativePath():String
Expand Down
41 changes: 6 additions & 35 deletions tool/src/massive/mlib/AllClasses.hx
Original file line number Diff line number Diff line change
@@ -1,44 +1,15 @@
/****
* Copyright 2012 Massive Interactive. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY MASSIVE INTERACTIVE "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MASSIVE INTERACTIVE OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of Massive Interactive.
*
****/

package massive.mlib;

import massive.mlib.cmd.ConfigMlibCommand;
import massive.mlib.cmd.GenerateAllClassesCommand;
import massive.mlib.cmd.IncrementHaxelibVersionCommand;
import massive.mlib.cmd.InstallToHaxelibCommand;
import massive.mlib.Mlib;
import massive.mlib.cmd.MlibCommand;
import massive.mlib.cmd.PackageForHaxelibCommand;
import massive.mlib.cmd.GenerateAllClassesCommand;
import massive.mlib.cmd.PreProcessHxmlCommand;
import massive.mlib.cmd.PackageForHaxelibCommand;
import massive.mlib.cmd.IncrementHaxelibVersionCommand;
import massive.mlib.cmd.SubmitToHaxelibCommand;
import massive.mlib.cmd.ConfigMlibCommand;
import massive.mlib.cmd.UpdateSourceLicenseCommand;
import massive.mlib.Mlib;
import massive.mlib.cmd.InstallToHaxelibCommand;
import massive.mlib.MlibSettings;

@IgnoreCover
Expand Down

0 comments on commit 3b903d2

Please sign in to comment.