Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 84
View file
lightspark.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package lightspark # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,23 +15,22 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -%if %packman_bs + +%if %{packman_bs} %bcond_without ffmpeg %bcond_without rtmp %else %bcond_with ffmpeg %bcond_with rtmp %endif - Name: lightspark -Version: 0.7.2.99+git20150927.1629 +Version: 0.7.2.99+git20151003.1109 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+ Group: Productivity/Multimedia/Other Url: https://launchpad.net/lightspark/ Source0: lightspark.tar.xz -Patch: build.patch BuildRequires: boost-devel BuildRequires: cmake BuildRequires: desktop-file-utils @@ -58,14 +57,15 @@ BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(pangocairo) BuildRequires: pkgconfig(sdl) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(zlib) +Recommends: %{_bindir}/gnash %if 0%{?suse_version} > 1310 BuildRequires: pkgconfig(tinfo) %endif -BuildRequires: pkgconfig(x11) -BuildRequires: pkgconfig(zlib) %if %{with rtmp} -BuildRequires: pkgconfig(librtmp) BuildRequires: pkgconfig(libcrypto) +BuildRequires: pkgconfig(librtmp) BuildRequires: pkgconfig(libssl) %endif %if %{with ffmpeg} @@ -74,7 +74,6 @@ #BuildRequires: pkgconfig(libavutil) BuildRequires: libffmpeg-devel %endif -Recommends: %{_bindir}/gnash %description Lightspark is a modern, free, open-source flash player implementation. @@ -92,7 +91,6 @@ %prep %setup -q -n %{name} -%patch -p1 %build export CFLAGS='%{optflags}' @@ -107,7 +105,7 @@ -DPLUGIN_DIRECTORY=%{_libdir}/browser-plugins \ -DENABLE_LIBAVCODEC=%{?with_ffmpeg:YES}%{!?with_ffmpeg:NO} \ -DENABLE_RTMP=%{?with_rtmp:YES}%{!?with_rtmp:NO} .. -make %{?jobs:-j%jobs} +make %{?_smp_mflags} %install cd build
View file
build.patch
Deleted
@@ -1,1780 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 81b6d9d..0b9790d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -247,6 +247,9 @@ ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.4) - IF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) - ADD_DEFINITIONS(-DLLVM_36) - ENDIF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) -+IF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) -+ ADD_DEFINITIONS(-DLLVM_37) -+ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) - INCLUDE(FindZLIB REQUIRED) - INCLUDE(FindFreetype REQUIRED) - IF(NOT(ENABLE_GLES2)) -@@ -312,6 +315,8 @@ IF(ENABLE_LIBAVCODEC) - CHECK_FUNCTION_EXISTS(avcodec_open2 HAVE_AVCODEC_OPEN2) - CHECK_FUNCTION_EXISTS(avformat_close_input HAVE_AVFORMAT_CLOSE_INPUT) - CHECK_FUNCTION_EXISTS(avformat_find_stream_info HAVE_AVFORMAT_FIND_STREAM_INFO) -+ CHECK_FUNCTION_EXISTS(av_frame_alloc HAVE_AV_FRAME_ALLOC) -+ CHECK_FUNCTION_EXISTS(av_frame_unref HAVE_AV_FRAME_UNREF) - CHECK_C_SOURCE_COMPILES("#include <libavcodec/avcodec.h>\nint main() { enum AVCodecID c; return 0; }" HAVE_AVCODECID) - - SET(CMAKE_REQUIRED_FLAGS) -@@ -347,6 +352,12 @@ IF(ENABLE_LIBAVCODEC) - IF(LIBAVRESAMPLE_FOUND) - ADD_DEFINITIONS(-DHAVE_LIBAVRESAMPLE) - ENDIF(LIBAVRESAMPLE_FOUND) -+ IF(HAVE_AV_FRAME_ALLOC) -+ ADD_DEFINITIONS(-DHAVE_AV_FRAME_ALLOC) -+ ENDIF(HAVE_AV_FRAME_ALLOC) -+ IF(HAVE_AV_FRAME_UNREF) -+ ADD_DEFINITIONS(-DHAVE_AV_FRAME_UNREF) -+ ENDIF(HAVE_AV_FRAME_UNREF) - ADD_DEFINITIONS(-DENABLE_LIBAVCODEC) - ENDIF(ENABLE_LIBAVCODEC) - -diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake -index e60dd4a..0f4f950 100644 ---- a/conf/FindLLVM.cmake -+++ b/conf/FindLLVM.cmake -@@ -57,6 +57,7 @@ else (LLVM_INCLUDE_DIR) - /usr/lib/llvm-3.4/bin - /usr/lib/llvm-3.5/bin - /usr/lib/llvm-3.6/bin -+ /usr/lib/llvm-3.7/bin - ) - - find_program(LLVM_GCC_EXECUTABLE -@@ -177,10 +178,12 @@ else (LLVM_INCLUDE_DIR) - check_include_file_cxx("llvm/DataLayout.h" HAVE_DATALAYOUT_H) - check_include_file_cxx("llvm/IR/DataLayout.h" HAVE_IR_DATALAYOUT_H) - check_include_file_cxx("llvm/IR/Verifier.h" HAVE_IR_VERIFIER_H) -+ check_include_file_cxx("llvm/PassManager.h" HAVE_PASSMANAGER_H) - unset(CMAKE_REQUIRED_INCLUDES) - MESSAGE(STATUS "HAVE_DATALAYOUT_H: " ${HAVE_DATALAYOUT_H}) - MESSAGE(STATUS "HAVE_IR_DATALAYOUT_H: " ${HAVE_IR_DATALAYOUT_H}) - MESSAGE(STATUS "HAVE_IR_VERIFIER_H: " ${HAVE_IR_VERIFIER_H}) -+ MESSAGE(STATUS "HAVE_PASSMANAGER_H: " ${HAVE_PASSMANAGER_H}) - IF(HAVE_DATALAYOUT_H) - ADD_DEFINITIONS(-DHAVE_DATALAYOUT_H) - ENDIF(HAVE_DATALAYOUT_H) -@@ -190,6 +193,9 @@ else (LLVM_INCLUDE_DIR) - IF(HAVE_IR_VERIFIER_H) - ADD_DEFINITIONS(-DHAVE_IR_VERIFIER_H) - ENDIF(HAVE_IR_VERIFIER_H) -+ IF(HAVE_PASSMANAGER_H) -+ ADD_DEFINITIONS(-DHAVE_PASSMANAGER_H) -+ ENDIF(HAVE_PASSMANAGER_H) - - exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS ) - MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS}) -diff --git a/src/backends/decoder.cpp b/src/backends/decoder.cpp -index fbdfcdb..98151c4 100755 ---- a/src/backends/decoder.cpp -+++ b/src/backends/decoder.cpp -@@ -30,6 +30,14 @@ - #define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO - #endif - -+#ifndef HAVE_AV_FRAME_ALLOC -+#define av_frame_alloc avcodec_alloc_frame -+#endif -+ -+#ifndef HAVE_AV_FRAME_UNREF -+#define av_frame_unref avcodec_get_frame_defaults -+#endif -+ - using namespace lightspark; - using namespace std; - -@@ -166,7 +174,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(LS_VIDEO_CODEC codecId, uint8_t* initdata - else - status=INIT; - -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - } - - FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint): -@@ -201,7 +209,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint) - if(fillDataAndCheckValidity()) - status=VALID; - -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - } - - FFMpegVideoDecoder::~FFMpegVideoDecoder() -@@ -476,7 +484,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC audioCodec, uint8_t* initd - else - status=INIT; - #if HAVE_AVCODEC_DECODE_AUDIO4 -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - #endif - } - -@@ -502,7 +510,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC lscodec, int sampleRate, i - if(fillDataAndCheckValidity()) - status=VALID; - #if HAVE_AVCODEC_DECODE_AUDIO4 -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - #endif - } - -@@ -522,7 +530,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecContext* _c):ownedContext(false),c - if(fillDataAndCheckValidity()) - status=VALID; - #if HAVE_AVCODEC_DECODE_AUDIO4 -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - #endif - } - -@@ -607,7 +615,7 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t - } - - #if HAVE_AVCODEC_DECODE_AUDIO4 -- avcodec_get_frame_defaults(frameIn); -+ av_frame_unref(frameIn); - int frameOk=0; - int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); - if(frameOk==0) -@@ -664,7 +672,7 @@ uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) - int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; - - #if HAVE_AVCODEC_DECODE_AUDIO4 -- avcodec_get_frame_defaults(frameIn); -+ av_frame_unref(frameIn); - int frameOk=0; - int ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, pkt); - if(frameOk==0) -diff --git a/src/backends/security.cpp b/src/backends/security.cpp -index 7cd8236..6eeffd7 100644 ---- a/src/backends/security.cpp -+++ b/src/backends/security.cpp -@@ -1298,7 +1298,7 @@ bool SocketPolicyFile::retrievePolicyFile(vector<unsigned char>& outData) - const char *socket_policy_cmd = "<policy-file-request/>\0"; - unsigned int socket_policy_cmd_len = strlen(socket_policy_cmd)+1; - ssize_t nbytes = sock.sendAll(socket_policy_cmd, socket_policy_cmd_len); -- if (nbytes != socket_policy_cmd_len) -+ if (nbytes != (int)socket_policy_cmd_len) - { - return false; - } -diff --git a/src/scripting/abc.cpp b/src/scripting/abc.cpp -index f159a73..6ce3235 100644 ---- a/src/scripting/abc.cpp -+++ b/src/scripting/abc.cpp -@@ -1641,7 +1641,7 @@ void ABCVm::Run(ABCVm* th) - #else - llvm::JITExceptionHandling = true; - #endif --#ifndef NDEBUG -+#if defined(NDEBUG) && !defined(LLVM_37) - #ifdef LLVM_31 - Opts.JITEmitDebugInfo = true; - #else -@@ -1665,7 +1665,9 @@ void ABCVm::Run(ABCVm* th) - - #ifdef LLVM_36 - th->FPM=new llvm::legacy::FunctionPassManager(th->module); -+#ifndef LLVM_37 - th->FPM->add(new llvm::DataLayoutPass()); -+#endif - #else - th->FPM=new llvm::FunctionPassManager(th->module); - #ifdef LLVM_35 -diff --git a/src/scripting/abc_codesynt.cpp b/src/scripting/abc_codesynt.cpp -index 2eb28fe..d07ccd6 100644 ---- a/src/scripting/abc_codesynt.cpp -+++ b/src/scripting/abc_codesynt.cpp -@@ -26,7 +26,11 @@ - - #include "compat.h" - #include <llvm/ExecutionEngine/ExecutionEngine.h> --#include <llvm/PassManager.h> -+#ifdef HAVE_PASSMANAGER_H
View file
lightspark.tar.xz/CMakeLists.txt
Changed
@@ -247,6 +247,9 @@ IF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) ADD_DEFINITIONS(-DLLVM_36) ENDIF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) +IF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) + ADD_DEFINITIONS(-DLLVM_37) +ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) INCLUDE(FindZLIB REQUIRED) INCLUDE(FindFreetype REQUIRED) IF(NOT(ENABLE_GLES2)) @@ -312,6 +315,8 @@ CHECK_FUNCTION_EXISTS(avcodec_open2 HAVE_AVCODEC_OPEN2) CHECK_FUNCTION_EXISTS(avformat_close_input HAVE_AVFORMAT_CLOSE_INPUT) CHECK_FUNCTION_EXISTS(avformat_find_stream_info HAVE_AVFORMAT_FIND_STREAM_INFO) + CHECK_FUNCTION_EXISTS(av_frame_alloc HAVE_AV_FRAME_ALLOC) + CHECK_FUNCTION_EXISTS(av_frame_unref HAVE_AV_FRAME_UNREF) CHECK_C_SOURCE_COMPILES("#include <libavcodec/avcodec.h>\nint main() { enum AVCodecID c; return 0; }" HAVE_AVCODECID) SET(CMAKE_REQUIRED_FLAGS) @@ -347,6 +352,12 @@ IF(LIBAVRESAMPLE_FOUND) ADD_DEFINITIONS(-DHAVE_LIBAVRESAMPLE) ENDIF(LIBAVRESAMPLE_FOUND) + IF(HAVE_AV_FRAME_ALLOC) + ADD_DEFINITIONS(-DHAVE_AV_FRAME_ALLOC) + ENDIF(HAVE_AV_FRAME_ALLOC) + IF(HAVE_AV_FRAME_UNREF) + ADD_DEFINITIONS(-DHAVE_AV_FRAME_UNREF) + ENDIF(HAVE_AV_FRAME_UNREF) ADD_DEFINITIONS(-DENABLE_LIBAVCODEC) ENDIF(ENABLE_LIBAVCODEC)
View file
lightspark.tar.xz/conf/FindLLVM.cmake
Changed
@@ -57,6 +57,7 @@ /usr/lib/llvm-3.4/bin /usr/lib/llvm-3.5/bin /usr/lib/llvm-3.6/bin + /usr/lib/llvm-3.7/bin ) find_program(LLVM_GCC_EXECUTABLE @@ -177,10 +178,12 @@ check_include_file_cxx("llvm/DataLayout.h" HAVE_DATALAYOUT_H) check_include_file_cxx("llvm/IR/DataLayout.h" HAVE_IR_DATALAYOUT_H) check_include_file_cxx("llvm/IR/Verifier.h" HAVE_IR_VERIFIER_H) + check_include_file_cxx("llvm/PassManager.h" HAVE_PASSMANAGER_H) unset(CMAKE_REQUIRED_INCLUDES) MESSAGE(STATUS "HAVE_DATALAYOUT_H: " ${HAVE_DATALAYOUT_H}) MESSAGE(STATUS "HAVE_IR_DATALAYOUT_H: " ${HAVE_IR_DATALAYOUT_H}) MESSAGE(STATUS "HAVE_IR_VERIFIER_H: " ${HAVE_IR_VERIFIER_H}) + MESSAGE(STATUS "HAVE_PASSMANAGER_H: " ${HAVE_PASSMANAGER_H}) IF(HAVE_DATALAYOUT_H) ADD_DEFINITIONS(-DHAVE_DATALAYOUT_H) ENDIF(HAVE_DATALAYOUT_H) @@ -190,6 +193,9 @@ IF(HAVE_IR_VERIFIER_H) ADD_DEFINITIONS(-DHAVE_IR_VERIFIER_H) ENDIF(HAVE_IR_VERIFIER_H) + IF(HAVE_PASSMANAGER_H) + ADD_DEFINITIONS(-DHAVE_PASSMANAGER_H) + ENDIF(HAVE_PASSMANAGER_H) exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS ) MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS})
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -1537,6 +1537,7 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) const { + bool amf0 = out->getObjectEncoding() == ObjectEncoding::AMF0; //Pairs of name, value auto it=Variables.begin(); for(;it!=Variables.end();it++) @@ -1545,26 +1546,41 @@ continue; //Dynamic traits always have empty namespace assert(it->first.ns.hasEmptyName()); - out->writeStringVR(stringMap,getSys()->getStringFromUniqueId(it->first.nameId)); + if (amf0) + out->writeStringAMF0(getSys()->getStringFromUniqueId(it->first.nameId)); + else + out->writeStringVR(stringMap,getSys()->getStringFromUniqueId(it->first.nameId)); it->second.var->serialize(out, stringMap, objMap, traitsMap); } //The empty string closes the object - out->writeStringVR(stringMap, ""); + if (!amf0) out->writeStringVR(stringMap, ""); } void ASObject::serialize(ByteArray* out, std::map<tiny_string, uint32_t>& stringMap, std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - //0x0A -> object marker - out->writeByte(object_marker); + bool amf0 = out->getObjectEncoding() == ObjectEncoding::AMF0; + if (amf0) + out->writeByte(amf0_object_marker); + else + out->writeByte(object_marker); //Check if the object has been already serialized to send it by reference auto it=objMap.find(this); if(it!=objMap.end()) { - //The least significant bit is 0 to signal a reference - out->writeU29(it->second << 1); + if (amf0) + { + out->writeByte(amf0_reference_marker); + out->writeShort(it->second); + } + else + { + //The least significant bit is 0 to signal a reference + out->writeU29(it->second << 1); + } return; + } Class_base* type=getClass(); @@ -1590,6 +1606,13 @@ //Custom serialization necessary if(!serializeTraits) throwError<TypeError>(kInvalidParamError); + if (amf0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing IExternalizable in AMF0 not implemented"); + out->writeShort(0); + out->writeByte(amf0_object_end_marker); + return; + } out->writeU29(0x7); out->writeStringVR(stringMap, alias); @@ -1618,6 +1641,35 @@ const variables_map::const_var_iterator endIt = Variables.Variables.end(); //Check if the class traits has been already serialized to send it by reference auto it2=traitsMap.find(type); + + if (amf0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing ASObject in AMF0 not completely implemented"); + if(it2!=traitsMap.end()) + { + out->writeByte(amf0_reference_marker); + out->writeShort(it2->second); + for(variables_map::const_var_iterator varIt=beginIt; varIt != endIt; ++varIt) + { + if(varIt->second.kind==DECLARED_TRAIT) + { + if(!varIt->first.ns.hasEmptyName()) + { + //Skip variable with a namespace, like protected ones + continue; + } + out->writeStringAMF0(getSys()->getStringFromUniqueId(varIt->first.nameId)); + varIt->second.var->serialize(out, stringMap, objMap, traitsMap); + } + } + } + if(!type->isSealed) + serializeDynamicProperties(out, stringMap, objMap, traitsMap); + out->writeShort(0); + out->writeByte(amf0_object_end_marker); + return; + } + if(it2!=traitsMap.end()) out->writeU29((it2->second << 2) | 1); else
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -30,6 +30,14 @@ #define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO #endif +#ifndef HAVE_AV_FRAME_ALLOC +#define av_frame_alloc avcodec_alloc_frame +#endif + +#ifndef HAVE_AV_FRAME_UNREF +#define av_frame_unref avcodec_get_frame_defaults +#endif + using namespace lightspark; using namespace std; @@ -166,7 +174,7 @@ else status=INIT; - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); } FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint): @@ -201,7 +209,7 @@ if(fillDataAndCheckValidity()) status=VALID; - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); } FFMpegVideoDecoder::~FFMpegVideoDecoder() @@ -476,7 +484,7 @@ else status=INIT; #if HAVE_AVCODEC_DECODE_AUDIO4 - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); #endif } @@ -502,7 +510,7 @@ if(fillDataAndCheckValidity()) status=VALID; #if HAVE_AVCODEC_DECODE_AUDIO4 - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); #endif } @@ -522,7 +530,7 @@ if(fillDataAndCheckValidity()) status=VALID; #if HAVE_AVCODEC_DECODE_AUDIO4 - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); #endif } @@ -607,7 +615,7 @@ } #if HAVE_AVCODEC_DECODE_AUDIO4 - avcodec_get_frame_defaults(frameIn); + av_frame_unref(frameIn); int frameOk=0; int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); if(frameOk==0) @@ -664,7 +672,7 @@ int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; #if HAVE_AVCODEC_DECODE_AUDIO4 - avcodec_get_frame_defaults(frameIn); + av_frame_unref(frameIn); int frameOk=0; int ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, pkt); if(frameOk==0)
View file
lightspark.tar.xz/src/backends/security.cpp
Changed
@@ -1298,7 +1298,7 @@ const char *socket_policy_cmd = "<policy-file-request/>\0"; unsigned int socket_policy_cmd_len = strlen(socket_policy_cmd)+1; ssize_t nbytes = sock.sendAll(socket_policy_cmd, socket_policy_cmd_len); - if (nbytes != socket_policy_cmd_len) + if (nbytes != (int)socket_policy_cmd_len) { return false; }
View file
lightspark.tar.xz/src/scripting/abc.cpp
Changed
@@ -1376,8 +1376,9 @@ ASObject* derived_class=root->applicationDomain->getVariableByString(s,target); if(derived_class==NULL) { - LOG(LOG_ERROR,_("Class ") << s << _(" not found in global for ")<<root->getOrigin()); - throw RunTimeException("Class not found in global"); + //LOG(LOG_ERROR,_("Class ") << s << _(" not found in global for ")<<root->getOrigin()); + //throw RunTimeException("Class not found in global"); + return NULL; } assert_and_throw(derived_class->getObjectType()==T_CLASS); @@ -1641,7 +1642,7 @@ #else llvm::JITExceptionHandling = true; #endif -#ifndef NDEBUG +#if defined(NDEBUG) && !defined(LLVM_37) #ifdef LLVM_31 Opts.JITEmitDebugInfo = true; #else @@ -1665,7 +1666,9 @@ #ifdef LLVM_36 th->FPM=new llvm::legacy::FunctionPassManager(th->module); +#ifndef LLVM_37 th->FPM->add(new llvm::DataLayoutPass()); +#endif #else th->FPM=new llvm::FunctionPassManager(th->module); #ifdef LLVM_35
View file
lightspark.tar.xz/src/scripting/abc_codesynt.cpp
Changed
@@ -26,7 +26,11 @@ #include "compat.h" #include <llvm/ExecutionEngine/ExecutionEngine.h> -#include <llvm/PassManager.h> +#ifdef HAVE_PASSMANAGER_H +# include <llvm/PassManager.h> +#else +# include <llvm/IR/LegacyPassManager.h> +#endif #ifdef HAVE_IR_DATALAYOUT_H # include <llvm/IR/Constants.h> # include <llvm/IR/DerivedTypes.h> @@ -819,13 +823,25 @@ stack_entry rt1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); /*if(rt1.second==STACK_INT) //TODO: for them, first parameter is call_context, not ABCContext +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname_i"), {context, rt1.first, mindx}); +#else name = Builder.CreateCall3(ex->FindFunctionNamed("getMultiname_i"), context, rt1.first, mindx); +#endif else if(rt1.second==STACK_NUMBER) +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname_d"), {context, rt1.first, mindx}); +#else name = Builder.CreateCall3(ex->FindFunctionNamed("getMultiname_d"), context, rt1.first, mindx); +#endif else*/ { abstract_value(ex,Builder,rt1); +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname"), {context, rt1.first, constnull, mindx}); +#else name = Builder.CreateCall4(ex->FindFunctionNamed("getMultiname"), context, rt1.first, constnull, mindx); +#endif } } else if(rtdata==2) @@ -834,7 +850,11 @@ stack_entry rt2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,rt1); abstract_value(ex,Builder,rt2); +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname"), {context, rt1.first, rt2.first, mindx}); +#else name = Builder.CreateCall4(ex->FindFunctionNamed("getMultiname"), context, rt1.first, rt2.first, mindx); +#endif } else assert(false); @@ -1868,7 +1888,11 @@ llvm::Value* context=it; //let's give access to local data storage - value=Builder.CreateStructGEP(context,0); + value=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,0); llvm::Value* locals=Builder.CreateLoad(value); //the stack is statically handled as much as possible to allow llvm optimizations @@ -1876,12 +1900,24 @@ vector<stack_entry> static_stack; static_stack.reserve(body->max_stack); //Get the pointer to the dynamic stack - value=Builder.CreateStructGEP(context,1); + value=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,1); llvm::Value* dynamic_stack=Builder.CreateLoad(value); //Get the index of the dynamic stack - llvm::Value* dynamic_stack_index=Builder.CreateStructGEP(context,2); + llvm::Value* dynamic_stack_index=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,2); - llvm::Value* exec_pos=Builder.CreateStructGEP(context,3); + llvm::Value* exec_pos=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,3); /* //Allocate a fast dynamic stack based on LLVM alloca instruction //This is used on branches @@ -2098,7 +2134,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("getSuper"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("getSuper"), context, constant); +#endif break; } case 0x05: @@ -2109,7 +2149,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("setSuper"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("setSuper"), context, constant); +#endif break; } case 0x06: @@ -2119,7 +2163,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("dxns"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("dxns"), context, constant); +#endif break; } case 0x07: @@ -2128,7 +2176,11 @@ LOG(LOG_TRACE, _("synt dxnslate") ); stack_entry v=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,v); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("dxns"), {context, v.first}); +#else Builder.CreateCall2(ex->FindFunctionNamed("dxns"), context, v.first); +#endif break; } case 0x08: @@ -2179,7 +2231,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifNLT"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNLT"), v1.first, v2.first); +#endif } syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2212,7 +2268,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNLE"), {v1.first, v2.first}); +#else llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNLE"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2245,7 +2305,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNGT"), {v1.first, v2.first}); +#else llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNGT"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2278,7 +2342,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNGE"), {v1.first, v2.first}); +#else llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNGE"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2401,7 +2469,11 @@ llvm::Value* cond; //Make comparision if(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifEq"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifEq"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_NUMBER) { v1.first=Builder.CreateSIToFP(v1.first,number_type);
View file
lightspark.tar.xz/src/scripting/avmplus/avmplus.cpp
Changed
@@ -56,7 +56,7 @@ } ASFUNCTIONBODY(avmplusFile,readByteArray) { - avmplusFile* th=static_cast<avmplusFile*>(obj); + //avmplusFile* th=static_cast<avmplusFile*>(obj); tiny_string filename; ARG_UNPACK(filename);
View file
lightspark.tar.xz/src/scripting/flash/display/BitmapData.cpp
Changed
@@ -141,7 +141,7 @@ uint8_t *alpha=reinterpret_cast<uint8_t *>(&c); *alpha=0xFF; } - for(uint32_t i=0; i<width*height; i++) + for(uint32_t i=0; i<(uint32_t)(width*height); i++) pixelArray[i]=c; th->pixels->fromRGB(reinterpret_cast<uint8_t *>(pixelArray), width, height, BitmapContainer::ARGB32); th->transparent=transparent; @@ -842,8 +842,6 @@ ASFUNCTIONBODY(BitmapData,applyFilter) { - BitmapData* th = obj->as<BitmapData>(); - _NR<BitmapData> sourceBitmapData; _NR<Rectangle> sourceRect; _NR<Point> destPoint; @@ -852,9 +850,9 @@ LOG(LOG_NOT_IMPLEMENTED,"BitmapData.applyFilter not implemented"); return NULL; } + ASFUNCTIONBODY(BitmapData,noise) { - BitmapData* th = obj->as<BitmapData>(); int randomSeed; uint low; uint high;
View file
lightspark.tar.xz/src/scripting/flash/events/flashevents.cpp
Changed
@@ -189,13 +189,13 @@ ASFUNCTIONBODY(Event,stopPropagation) { - Event* th=static_cast<Event*>(obj); + //Event* th=static_cast<Event*>(obj); LOG(LOG_NOT_IMPLEMENTED,"Event.stopPropagation not implemented"); return NULL; } ASFUNCTIONBODY(Event,stopImmediatePropagation) { - Event* th=static_cast<Event*>(obj); + //Event* th=static_cast<Event*>(obj); LOG(LOG_NOT_IMPLEMENTED,"Event.stopImmediatePropagation not implemented"); return NULL; } @@ -1420,8 +1420,8 @@ ASFUNCTIONBODY(UncaughtErrorEvents, _constructor) { - EventDispatcher::_constructor(obj, NULL, 0); - UncaughtErrorEvents* th=Class<UncaughtErrorEvents>::cast(obj); + //EventDispatcher::_constructor(obj, NULL, 0); + //UncaughtErrorEvents* th=Class<UncaughtErrorEvents>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"UncaughtErrorEvents is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/filesystem/flashfilesystem.cpp
Changed
@@ -36,7 +36,7 @@ ASFUNCTIONBODY(FileStream, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - FileStream* th=Class<FileStream>::cast(obj); + //FileStream* th=Class<FileStream>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"FileStream is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/filters/flashfilters.cpp
Changed
@@ -178,15 +178,14 @@ ASFUNCTIONBODY(GradientGlowFilter, _constructor) { - GradientGlowFilter *th = obj->as<GradientGlowFilter>(); + //GradientGlowFilter *th = obj->as<GradientGlowFilter>(); LOG(LOG_NOT_IMPLEMENTED,"GradientGlowFilter is not implemented"); return NULL; } BitmapFilter* GradientGlowFilter::cloneImpl() const { - GradientGlowFilter *cloned = Class<GradientGlowFilter>::getInstanceS(); - return cloned; + return Class<GradientGlowFilter>::getInstanceS(); } BevelFilter::BevelFilter(Class_base* c): @@ -201,15 +200,14 @@ ASFUNCTIONBODY(BevelFilter, _constructor) { - BevelFilter *th = obj->as<BevelFilter>(); + //BevelFilter *th = obj->as<BevelFilter>(); LOG(LOG_NOT_IMPLEMENTED,"GradientGlowFilter is not implemented"); return NULL; } BitmapFilter* BevelFilter::cloneImpl() const { - BevelFilter *cloned = Class<BevelFilter>::getInstanceS(); - return cloned; + return Class<BevelFilter>::getInstanceS(); } ColorMatrixFilter::ColorMatrixFilter(Class_base* c): BitmapFilter(c),matrix(NULL) @@ -253,15 +251,14 @@ ASFUNCTIONBODY(BlurFilter, _constructor) { - BlurFilter *th = obj->as<BlurFilter>(); + //BlurFilter *th = obj->as<BlurFilter>(); LOG(LOG_NOT_IMPLEMENTED,"BlurFilter is not implemented"); return NULL; } BitmapFilter* BlurFilter::cloneImpl() const { - BlurFilter *cloned = Class<BlurFilter>::getInstanceS(); - return cloned; + return Class<BlurFilter>::getInstanceS(); } ConvolutionFilter::ConvolutionFilter(Class_base* c): @@ -276,15 +273,14 @@ ASFUNCTIONBODY(ConvolutionFilter, _constructor) { - ConvolutionFilter *th = obj->as<ConvolutionFilter>(); + //ConvolutionFilter *th = obj->as<ConvolutionFilter>(); LOG(LOG_NOT_IMPLEMENTED,"ConvolutionFilter is not implemented"); return NULL; } BitmapFilter* ConvolutionFilter::cloneImpl() const { - ConvolutionFilter *cloned = Class<ConvolutionFilter>::getInstanceS(); - return cloned; + return Class<ConvolutionFilter>::getInstanceS(); } DisplacementMapFilter::DisplacementMapFilter(Class_base* c): @@ -299,15 +295,14 @@ ASFUNCTIONBODY(DisplacementMapFilter, _constructor) { - DisplacementMapFilter *th = obj->as<DisplacementMapFilter>(); + //DisplacementMapFilter *th = obj->as<DisplacementMapFilter>(); LOG(LOG_NOT_IMPLEMENTED,"DisplacementMapFilter is not implemented"); return NULL; } BitmapFilter* DisplacementMapFilter::cloneImpl() const { - DisplacementMapFilter *cloned = Class<DisplacementMapFilter>::getInstanceS(); - return cloned; + return Class<DisplacementMapFilter>::getInstanceS(); } GradientBevelFilter::GradientBevelFilter(Class_base* c): @@ -322,15 +317,14 @@ ASFUNCTIONBODY(GradientBevelFilter, _constructor) { - GradientBevelFilter *th = obj->as<GradientBevelFilter>(); + //GradientBevelFilter *th = obj->as<GradientBevelFilter>(); LOG(LOG_NOT_IMPLEMENTED,"GradientBevelFilter is not implemented"); return NULL; } BitmapFilter* GradientBevelFilter::cloneImpl() const { - GradientBevelFilter *cloned = Class<GradientBevelFilter>::getInstanceS(); - return cloned; + return Class<GradientBevelFilter>::getInstanceS(); } ShaderFilter::ShaderFilter(Class_base* c): @@ -345,15 +339,14 @@ ASFUNCTIONBODY(ShaderFilter, _constructor) { - ShaderFilter *th = obj->as<ShaderFilter>(); + //ShaderFilter *th = obj->as<ShaderFilter>(); LOG(LOG_NOT_IMPLEMENTED,"ShaderFilter is not implemented"); return NULL; } BitmapFilter* ShaderFilter::cloneImpl() const { - ShaderFilter *cloned = Class<ShaderFilter>::getInstanceS(); - return cloned; + return Class<ShaderFilter>::getInstanceS(); } void BitmapFilterQuality::sinit(Class_base* c)
View file
lightspark.tar.xz/src/scripting/flash/geom/flashgeom.cpp
Changed
@@ -987,7 +987,7 @@ ASFUNCTIONBODY(Transform,_getConcatenatedMatrix) { - Transform* th=Class<Transform>::cast(obj); + //Transform* th=Class<Transform>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"contcatenatedMAtrix not implemented"); return Class<Matrix>::getInstanceS(); } @@ -1721,7 +1721,7 @@ ASFUNCTIONBODY(Matrix3D,_constructor) { - Matrix3D * th=static_cast<Matrix3D*>(obj); + //Matrix3D * th=static_cast<Matrix3D*>(obj); LOG(LOG_NOT_IMPLEMENTED,"Matrix3D is not implemented"); return NULL; } @@ -1733,7 +1733,7 @@ ASFUNCTIONBODY(PerspectiveProjection,_constructor) { - PerspectiveProjection * th=static_cast<PerspectiveProjection*>(obj); + //PerspectiveProjection * th=static_cast<PerspectiveProjection*>(obj); LOG(LOG_NOT_IMPLEMENTED,"PerspectiveProjection is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/net/URLStream.cpp
Changed
@@ -90,6 +90,8 @@ // Don't send any events if the thread is aborting if(success && !threadAborting) { + loader->incRef(); + getVm()->addEvent(loader,_MR(Class<ProgressEvent>::getInstanceS(downloader->getLength(),downloader->getLength()))); //Send a complete event for this object loader->incRef(); getVm()->addEvent(loader,_MR(Class<Event>::getInstanceS("complete")));
View file
lightspark.tar.xz/src/scripting/flash/net/XMLSocket.cpp
Changed
@@ -507,10 +507,16 @@ tiny_string *packet = new tiny_string(data); g_async_queue_push(sendQueue, packet); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-result" write(signalEmitter, &SOCKET_COMMAND_SEND, 1); +#pragma GCC diagnostic pop } void XMLSocketThread::requestClose() { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-result" write(signalEmitter, &SOCKET_COMMAND_CLOSE, 1); +#pragma GCC diagnostic pop }
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.cpp
Changed
@@ -1031,8 +1031,8 @@ NetStream::NetStream(Class_base* c):EventDispatcher(c),tickStarted(false),paused(false),closed(true), streamTime(0),frameRate(0),connection(),downloader(NULL),videoDecoder(NULL), - audioDecoder(NULL),audioStream(NULL),datagenerationfile(NULL),datagenerationthreadstarted(false),framesdecoded(0), - client(NullRef),oldVolume(-1.0),checkPolicyFile(false),rawAccessAllowed(false),playbackBytesPerSecond(0), + audioDecoder(NULL),audioStream(NULL),datagenerationfile(NULL),datagenerationthreadstarted(false),client(NullRef), + oldVolume(-1.0),checkPolicyFile(false),rawAccessAllowed(false),framesdecoded(0),playbackBytesPerSecond(0), backBufferLength(0),backBufferTime(30),bufferLength(0),bufferTime(0.1),bufferTimeMax(0), maxPauseBufferTime(0) { @@ -2135,31 +2135,31 @@ } ASFUNCTIONBODY(LocalConnection, allowDomain) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::allowDomain is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, allowInsecureDomain) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::allowInsecureDomain is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, send) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::send is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, connect) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::connect is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, close) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::close is not implemented"); return NULL; } @@ -2177,7 +2177,7 @@ ASFUNCTIONBODY(NetGroup, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - NetGroup* th=Class<NetGroup>::cast(obj); + //NetGroup* th=Class<NetGroup>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"NetGroup is not implemented"); return NULL; } @@ -2196,7 +2196,7 @@ ASFUNCTIONBODY(ASSocket, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - ASSocket* th=Class<ASSocket>::cast(obj); + //ASSocket* th=Class<ASSocket>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"ASSocket is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/printing/flashprinting.cpp
Changed
@@ -39,7 +39,7 @@ ASFUNCTIONBODY(PrintJob, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - PrintJob* th=Class<PrintJob>::cast(obj); + //PrintJob* th=Class<PrintJob>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"PrintJob is not implemented"); return NULL; } @@ -56,7 +56,7 @@ ASFUNCTIONBODY(PrintJobOptions, _constructor) { - PrintJobOptions* th=Class<PrintJobOptions>::cast(obj); + //PrintJobOptions* th=Class<PrintJobOptions>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"PrintJobOptions is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/utils/ByteArray.cpp
Changed
@@ -552,14 +552,6 @@ { //Return the length of the serialized object - //TODO: support AMF0 - - if (objectEncoding==ObjectEncoding::AMF0) - { - LOG(LOG_NOT_IMPLEMENTED,"ByteArray.writeObject: writing AMF0 objects not implemented"); - //return 0; - } - //assert_and_throw(objectEncoding==ObjectEncoding::AMF3); //TODO: support custom serialization map<tiny_string, uint32_t> stringMap; map<const ASObject*, uint32_t> objMap; @@ -1178,6 +1170,23 @@ } } +void ByteArray::writeStringAMF0(const tiny_string& s) +{ + const uint32_t len=s.numBytes(); + if(len <= 0xffff) + { + writeUTF(s); + } + else + { + getBuffer(position+len+4,true); + uint32_t numBytes=endianIn((uint32_t)len); + memcpy(bytes+position,&numBytes,4); + memcpy(bytes+position+4,s.raw_buf(),len); + position+=len+4; + } +} + void ByteArray::writeXMLString(std::map<const ASObject*, uint32_t>& objMap, ASObject *xml, const tiny_string& xmlstr) @@ -1463,6 +1472,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing ByteArray in AMF0 not implemented"); + return; + } assert_and_throw(objMap.find(this)==objMap.end()); out->writeByte(byte_array_marker); //Check if the bytearray has been already serialized
View file
lightspark.tar.xz/src/scripting/flash/utils/ByteArray.h
Changed
@@ -62,6 +62,7 @@ void writeUTF(const tiny_string& str); uint32_t writeObject(ASObject* obj); void writeStringVR(std::map<tiny_string, uint32_t>& stringMap, const tiny_string& s); + void writeStringAMF0(const tiny_string& s); void writeXMLString(std::map<const ASObject*, uint32_t>& objMap, ASObject *xml, const tiny_string& s); void writeU29(uint32_t val); @@ -73,6 +74,7 @@ void append(std::streambuf* data, int length); + uint8_t getObjectEncoding() const { return objectEncoding; } uint8_t getCurrentObjectEncoding() const { return currentObjectEncoding; } void setCurrentObjectEncoding(uint8_t encoding) { currentObjectEncoding = encoding; }
View file
lightspark.tar.xz/src/scripting/flash/utils/Dictionary.cpp
Changed
@@ -357,6 +357,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Dictionary in AMF0 not implemented"); + return; + } assert_and_throw(objMap.find(this)==objMap.end()); out->writeByte(dictionary_marker); //Check if the dictionary has been already serialized
View file
lightspark.tar.xz/src/scripting/flash/xml/flashxml.cpp
Changed
@@ -309,6 +309,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing XMLDocument in AMF0 not implemented"); + return; + } out->writeByte(xml_doc_marker); out->writeXMLString(objMap, this, toString()); }
View file
lightspark.tar.xz/src/scripting/toplevel/ASString.cpp
Changed
@@ -585,8 +585,16 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - out->writeByte(string_marker); - out->writeStringVR(stringMap, data); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_string_marker); + out->writeStringAMF0(data); + } + else + { + out->writeByte(string_marker); + out->writeStringVR(stringMap, data); + } } ASFUNCTIONBODY(ASString,slice)
View file
lightspark.tar.xz/src/scripting/toplevel/Array.cpp
Changed
@@ -1573,6 +1573,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Array in AMF0 not implemented"); + return; + } assert_and_throw(objMap.find(this)==objMap.end()); out->writeByte(array_marker); //Check if the array has been already serialized
View file
lightspark.tar.xz/src/scripting/toplevel/Boolean.cpp
Changed
@@ -126,10 +126,13 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - if(val) - out->writeByte(true_marker); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_boolean_marker); + out->writeByte(val ? 1:0); + } else - out->writeByte(false_marker); + out->writeByte(val ? true_marker : false_marker); } bool Boolean::isEqual(ASObject* r)
View file
lightspark.tar.xz/src/scripting/toplevel/Date.cpp
Changed
@@ -1133,6 +1133,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Date in AMF0 not implemented"); + return; + } number_t val = getMsSinceEpoch(); out->writeByte(date_marker); auto it=objMap.find(this);
View file
lightspark.tar.xz/src/scripting/toplevel/Integer.cpp
Changed
@@ -213,6 +213,13 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + // write as double + out->writeByte(amf0_number_marker); + out->serializeDouble(val); + return; + } if(val>=0x40000000 || val<=(int32_t)0xbfffffff) { // write as double @@ -247,8 +254,19 @@ //Skip leading zeroes if (radix == 0) { + int count=0; while(*cur=='0') + { cur++; + count++; + } + + //The string consisted of all zeroes + if(count>0 && *cur=='\0') + { + ret = 0; + return true; + } } errno=0;
View file
lightspark.tar.xz/src/scripting/toplevel/Number.cpp
Changed
@@ -529,6 +529,12 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_number_marker); + out->serializeDouble(val); + return; + } out->writeByte(double_marker); out->serializeDouble(val); }
View file
lightspark.tar.xz/src/scripting/toplevel/UInteger.cpp
Changed
@@ -211,6 +211,12 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_number_marker); + out->serializeDouble(val); + return; + } if(val>=0x40000000) { // write as double
View file
lightspark.tar.xz/src/scripting/toplevel/Vector.cpp
Changed
@@ -1158,6 +1158,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Vector in AMF0 not implemented"); + return; + } uint8_t marker = 0; if (vec_type == Class<Integer>::getClass()) marker = vector_int_marker;
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -2402,6 +2402,12 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing XML in AMF0 not implemented"); + return; + } + out->writeByte(xml_marker); out->writeXMLString(objMap, this, toString()); }
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.cpp
Changed
@@ -117,7 +117,10 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - out->writeByte(undefined_marker); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + out->writeByte(amf0_undefined_marker); + else + out->writeByte(undefined_marker); } void Undefined::setVariableByMultiname(const multiname& name, ASObject* o, CONST_ALLOWED_FLAG allowConst) @@ -662,7 +665,10 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - out->writeByte(null_marker); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + out->writeByte(amf0_null_marker); + else + out->writeByte(null_marker); } void Null::setVariableByMultiname(const multiname& name, ASObject* o, CONST_ALLOWED_FLAG allowConst)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.