From cf4d8eef16956b64cd47ff1ead7f3de75ea7d3a5 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Thu, 17 Dec 2020 15:07:36 -0500 Subject: [PATCH] Revert "replace fprintf with absl::FPrintF" This reverts commit 4d88f18c81d3db9515aa4dd9699b2488844bdbfe. --- indra/llcommon/llerror.cpp | 4 +- indra/llmath/llvolume.cpp | 56 ++++++++++++------------- indra/llmessage/lldatapacker.cpp | 36 ++++++++-------- indra/llmessage/message.cpp | 24 ++++++----- indra/llxml/llxmlnode.cpp | 2 +- indra/newview/llconversationlog.cpp | 2 +- indra/newview/llmutelist.cpp | 12 +++--- indra/newview/llvoavatar.cpp | 64 +++++++++++++++-------------- indra/newview/llvoavatar.h | 2 +- indra/newview/llvoavatarself.cpp | 9 ++-- indra/newview/llvoavatarself.h | 2 +- 11 files changed, 110 insertions(+), 103 deletions(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 0270d191ae6..ad91d4318b4 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -234,7 +234,7 @@ namespace { } else { - absl::FPrintF(stderr, "%s\n", message); + fprintf(stderr, "%s\n", message.c_str()); } } @@ -247,7 +247,7 @@ namespace { static std::string s_ansi_reset = createANSI("0"); // reset // ANSI color code escape sequence, message, and reset in one fprintf call // Default all message levels to bold so we can distinguish our own messages from those dumped by subprocesses and libraries. - absl::FPrintF(stderr, "%s%s%s\n%s", s_ansi_bold, ansi_code, message, s_ansi_reset); + fprintf(stderr, "%s%s%s\n%s", s_ansi_bold.c_str(), ansi_code.c_str(), message.c_str(), s_ansi_reset.c_str() ); } static bool checkANSI(void) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index dc6dfef7b9c..70705bbd159 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1158,13 +1158,13 @@ BOOL LLProfileParams::importFile(LLFILE *fp) BOOL LLProfileParams::exportFile(LLFILE *fp) const { - absl::FPrintF(fp,"\t\tprofile 0\n"); - absl::FPrintF(fp,"\t\t{\n"); - absl::FPrintF(fp,"\t\t\tcurve\t%d\n", getCurveType()); - absl::FPrintF(fp,"\t\t\tbegin\t%g\n", getBegin()); - absl::FPrintF(fp,"\t\t\tend\t%g\n", getEnd()); - absl::FPrintF(fp,"\t\t\thollow\t%g\n", getHollow()); - absl::FPrintF(fp, "\t\t}\n"); + fprintf(fp,"\t\tprofile 0\n"); + fprintf(fp,"\t\t{\n"); + fprintf(fp,"\t\t\tcurve\t%d\n", getCurveType()); + fprintf(fp,"\t\t\tbegin\t%g\n", getBegin()); + fprintf(fp,"\t\t\tend\t%g\n", getEnd()); + fprintf(fp,"\t\t\thollow\t%g\n", getHollow()); + fprintf(fp, "\t\t}\n"); return TRUE; } @@ -1811,25 +1811,25 @@ BOOL LLPathParams::importFile(LLFILE *fp) BOOL LLPathParams::exportFile(LLFILE *fp) const { - absl::FPrintF(fp, "\t\tpath 0\n"); - absl::FPrintF(fp, "\t\t{\n"); - absl::FPrintF(fp, "\t\t\tcurve\t%d\n", getCurveType()); - absl::FPrintF(fp, "\t\t\tbegin\t%g\n", getBegin()); - absl::FPrintF(fp, "\t\t\tend\t%g\n", getEnd()); - absl::FPrintF(fp, "\t\t\tscale_x\t%g\n", getScaleX() ); - absl::FPrintF(fp, "\t\t\tscale_y\t%g\n", getScaleY() ); - absl::FPrintF(fp, "\t\t\tshear_x\t%g\n", getShearX() ); - absl::FPrintF(fp, "\t\t\tshear_y\t%g\n", getShearY() ); - absl::FPrintF(fp,"\t\t\ttwist\t%g\n", getTwist()); + fprintf(fp, "\t\tpath 0\n"); + fprintf(fp, "\t\t{\n"); + fprintf(fp, "\t\t\tcurve\t%d\n", getCurveType()); + fprintf(fp, "\t\t\tbegin\t%g\n", getBegin()); + fprintf(fp, "\t\t\tend\t%g\n", getEnd()); + fprintf(fp, "\t\t\tscale_x\t%g\n", getScaleX() ); + fprintf(fp, "\t\t\tscale_y\t%g\n", getScaleY() ); + fprintf(fp, "\t\t\tshear_x\t%g\n", getShearX() ); + fprintf(fp, "\t\t\tshear_y\t%g\n", getShearY() ); + fprintf(fp,"\t\t\ttwist\t%g\n", getTwist()); - absl::FPrintF(fp,"\t\t\ttwist_begin\t%g\n", getTwistBegin()); - absl::FPrintF(fp,"\t\t\tradius_offset\t%g\n", getRadiusOffset()); - absl::FPrintF(fp,"\t\t\ttaper_x\t%g\n", getTaperX()); - absl::FPrintF(fp,"\t\t\ttaper_y\t%g\n", getTaperY()); - absl::FPrintF(fp,"\t\t\trevolutions\t%g\n", getRevolutions()); - absl::FPrintF(fp,"\t\t\tskew\t%g\n", getSkew()); - - absl::FPrintF(fp, "\t\t}\n"); + fprintf(fp,"\t\t\ttwist_begin\t%g\n", getTwistBegin()); + fprintf(fp,"\t\t\tradius_offset\t%g\n", getRadiusOffset()); + fprintf(fp,"\t\t\ttaper_x\t%g\n", getTaperX()); + fprintf(fp,"\t\t\ttaper_y\t%g\n", getTaperY()); + fprintf(fp,"\t\t\trevolutions\t%g\n", getRevolutions()); + fprintf(fp,"\t\t\tskew\t%g\n", getSkew()); + + fprintf(fp, "\t\t}\n"); return TRUE; } @@ -4265,11 +4265,11 @@ BOOL LLVolumeParams::importFile(LLFILE *fp) BOOL LLVolumeParams::exportFile(LLFILE *fp) const { - absl::FPrintF(fp,"\tshape 0\n"); - absl::FPrintF(fp,"\t{\n"); + fprintf(fp,"\tshape 0\n"); + fprintf(fp,"\t{\n"); mPathParams.exportFile(fp); mProfileParams.exportFile(fp); - absl::FPrintF(fp, "\t}\n"); + fprintf(fp, "\t}\n"); return TRUE; } diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 68f660a286b..6edb473fac6 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -1444,7 +1444,7 @@ BOOL LLDataPackerAsciiFile::packString(const std::string& value, const char *nam writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%s\n", value.c_str()); + fprintf(mFP,"%s\n", value.c_str()); } else if (mOutputStream) { @@ -1473,14 +1473,14 @@ BOOL LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char if (mFP) { - absl::FPrintF(mFP, "%010d ", size); + fprintf(mFP, "%010d ", size); S32 i; for (i = 0; i < size; i++) { - absl::FPrintF(mFP, "%02x ", value[i]); + fprintf(mFP, "%02x ", value[i]); } - absl::FPrintF(mFP, "\n"); + fprintf(mFP, "\n"); } else if (mOutputStream) { @@ -1535,9 +1535,9 @@ BOOL LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const S32 i; for (i = 0; i < size; i++) { - absl::FPrintF(mFP, "%02x ", value[i]); + fprintf(mFP, "%02x ", value[i]); } - absl::FPrintF(mFP, "\n"); + fprintf(mFP, "\n"); } else if (mOutputStream) { @@ -1584,7 +1584,7 @@ BOOL LLDataPackerAsciiFile::packU8(const U8 value, const char *name) writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%d\n", value); + fprintf(mFP,"%d\n", value); } else if (mOutputStream) { @@ -1617,7 +1617,7 @@ BOOL LLDataPackerAsciiFile::packU16(const U16 value, const char *name) writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%d\n", value); + fprintf(mFP,"%d\n", value); } else if (mOutputStream) { @@ -1649,7 +1649,7 @@ BOOL LLDataPackerAsciiFile::packU32(const U32 value, const char *name) writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%u\n", value); + fprintf(mFP,"%u\n", value); } else if (mOutputStream) { @@ -1679,7 +1679,7 @@ BOOL LLDataPackerAsciiFile::packS32(const S32 value, const char *name) writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%d\n", value); + fprintf(mFP,"%d\n", value); } else if (mOutputStream) { @@ -1709,7 +1709,7 @@ BOOL LLDataPackerAsciiFile::packF32(const F32 value, const char *name) writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%f\n", value); + fprintf(mFP,"%f\n", value); } else if (mOutputStream) { @@ -1739,7 +1739,7 @@ BOOL LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name) writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); + fprintf(mFP,"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); } else if (mOutputStream) { @@ -1768,7 +1768,7 @@ BOOL LLDataPackerAsciiFile::packColor4U(const LLColor4U &value, const char *name writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%d %d %d %d\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); + fprintf(mFP,"%d %d %d %d\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); } else if (mOutputStream) { @@ -1804,7 +1804,7 @@ BOOL LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%f %f\n", value.mV[0], value.mV[1]); + fprintf(mFP,"%f %f\n", value.mV[0], value.mV[1]); } else if (mOutputStream) { @@ -1834,7 +1834,7 @@ BOOL LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); + fprintf(mFP,"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); } else if (mOutputStream) { @@ -1863,7 +1863,7 @@ BOOL LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name writeIndentedName(name); if (mFP) { - absl::FPrintF(mFP,"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); + fprintf(mFP,"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); } else if (mOutputStream) { @@ -1895,7 +1895,7 @@ BOOL LLDataPackerAsciiFile::packUUID(const LLUUID &value, const char *name) value.toString(tmp_str); if (mFP) { - absl::FPrintF(mFP,"%s\n", tmp_str); + fprintf(mFP,"%s\n", tmp_str.c_str()); } else if (mOutputStream) { @@ -1935,7 +1935,7 @@ void LLDataPackerAsciiFile::writeIndentedName(const char *name) indent_buf[i] = 0; if (mFP) { - absl::FPrintF(mFP,"%s%s\t",indent_buf, name); + fprintf(mFP,"%s%s\t",indent_buf.c_str(), name); } else if (mOutputStream) { diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 81bf481be85..89ffcf0b5cd 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -2369,10 +2369,10 @@ void dump_prehash_files() { U32 i; std::string filename("../../../indra/llmessage/message_prehash.h"); - LLUniqueFile fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ + LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ if (fp) { - absl::FPrintF( + fprintf( fp, "/**\n" " * @file message_prehash.h\n" @@ -2400,27 +2400,28 @@ void dump_prehash_files() " * $/LicenseInfo$\n" " */\n\n" "#ifndef LL_MESSAGE_PREHASH_H\n#define LL_MESSAGE_PREHASH_H\n\n"); - absl::FPrintF( + fprintf( fp, "/**\n" " * Generated from message template version number %.3f\n" " */\n", gMessageSystem->mMessageFileVersionNumber); - absl::FPrintF(fp, "\n\nextern F32 const gPrehashVersionNumber;\n\n"); + fprintf(fp, "\n\nextern F32 const gPrehashVersionNumber;\n\n"); for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++) { if (!LLMessageStringTable::getInstance()->mEmpty[i] && LLMessageStringTable::getInstance()->mString[i][0] != '.') { - absl::FPrintF(fp, "extern char const* const _PREHASH_%s;\n", LLMessageStringTable::getInstance()->mString[i]); + fprintf(fp, "extern char const* const _PREHASH_%s;\n", LLMessageStringTable::getInstance()->mString[i]); } } - absl::FPrintF(fp, "\n\n#endif\n"); + fprintf(fp, "\n\n#endif\n"); + fclose(fp); } filename = std::string("../../../indra/llmessage/message_prehash.cpp"); fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ if (fp) { - absl::FPrintF( + fprintf( fp, "/**\n" " * @file message_prehash.cpp\n" @@ -2451,16 +2452,17 @@ void dump_prehash_files() " * Generated from message template version number %.3f\n" " */\n", gMessageSystem->mMessageFileVersionNumber); - absl::FPrintF(fp, "#include \"linden_common.h\"\n"); - absl::FPrintF(fp, "#include \"message.h\"\n\n"); - absl::FPrintF(fp, "\n\nF32 const gPrehashVersionNumber = %.3ff;\n\n", gMessageSystem->mMessageFileVersionNumber); + fprintf(fp, "#include \"linden_common.h\"\n"); + fprintf(fp, "#include \"message.h\"\n\n"); + fprintf(fp, "\n\nF32 const gPrehashVersionNumber = %.3ff;\n\n", gMessageSystem->mMessageFileVersionNumber); for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++) { if (!LLMessageStringTable::getInstance()->mEmpty[i] && LLMessageStringTable::getInstance()->mString[i][0] != '.') { - absl::FPrintF(fp, "char const* const _PREHASH_%s = LLMessageStringTable::getInstance()->getString(\"%s\");\n", LLMessageStringTable::getInstance()->mString[i], LLMessageStringTable::getInstance()->mString[i]); + fprintf(fp, "char const* const _PREHASH_%s = LLMessageStringTable::getInstance()->getString(\"%s\");\n", LLMessageStringTable::getInstance()->mString[i], LLMessageStringTable::getInstance()->mString[i]); } } + fclose(fp); } } diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index caab49a1724..3e0951ef32c 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -881,7 +881,7 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root, // static void LLXMLNode::writeHeaderToFile(LLFILE *out_file) { - absl::FPrintF(out_file, "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"); + fprintf(out_file, "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"); } void LLXMLNode::writeToFile(LLFILE *out_file, const std::string& indent, bool use_type_decorations) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index f7cc247c84e..6bfb0fa4a73 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -488,7 +488,7 @@ bool LLConversationLog::saveToFile(const std::string& filename) // examples of two file entries // [1343221177] 0 1 0 John Doe| 7e4ec5be-783f-49f5-71dz-16c58c64c145 4ec62a74-c246-0d25-2af6-846beac2aa55 john.doe| // [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a| - absl::FPrintF(fp, "[%lld] %d %d %d %s| %s %s %s|\n", + fprintf(fp, "[%lld] %d %d %d %s| %s %s %s|\n", (S64)conv_it->getTime().value(), (S32)conv_it->getConversationType(), (S32)0, diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index bb46c80b812..64df449c269 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -598,7 +598,7 @@ BOOL LLMuteList::saveToFile(const std::string& filename) return FALSE; } - LLUniqueFile fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/ + LLFILE* fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/ if (!fp) { LL_WARNS() << "Couldn't open mute list " << filename << LL_ENDL; @@ -611,7 +611,7 @@ BOOL LLMuteList::saveToFile(const std::string& filename) it != mLegacyMutes.end(); ++it) { - absl::FPrintF(fp, "%d %s %s|\n", (S32)LLMute::BY_NAME, id_string, *it); + fprintf(fp, "%d %s %s|\n", (S32)LLMute::BY_NAME, id_string.c_str(), it->c_str()); } for (mute_set_t::iterator it = mMutes.begin(); it != mMutes.end(); @@ -621,9 +621,9 @@ BOOL LLMuteList::saveToFile(const std::string& filename) //be valid next time anyway. if (it->mType != LLMute::EXTERNAL) { - const LLUUID& id = it->mID; + it->mID.toString(id_string); const std::string& name = it->mName; - absl::FPrintF(fp, "%d %s %s|%u\n", (S32)it->mType, id, name, it->mFlags); + fprintf(fp, "%d %s %s|%u\n", (S32)it->mType, id_string.c_str(), name.c_str(), it->mFlags); } } fclose(fp); @@ -826,7 +826,9 @@ bool LLRenderMuteList::saveToFile() { if (it->second != 0) { - absl::FPrintF(fp, "%d %s [%d]\n", (S32)it->second, it->first, (S32)sVisuallyMuteDateMap[it->first]); + std::string id_string; + it->first.toString(id_string); + fprintf(fp, "%d %s [%d]\n", (S32)it->second, id_string.c_str(), (S32)sVisuallyMuteDateMap[it->first]); } } fclose(fp); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8caedc7706c..1c0c12e668b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8788,7 +8788,7 @@ bool LLVOAvatar::visualParamWeightsAreDefault() return rtn; } -void dump_visual_param(LLFILE* file, LLVisualParam* viewer_param, F32 value) +void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value) { std::string type_string = "unknown"; if (dynamic_cast<LLTexLayerParamAlpha*>(viewer_param)) @@ -8808,7 +8808,7 @@ void dump_visual_param(LLFILE* file, LLVisualParam* viewer_param, F32 value) wtype = vparam->getWearableType(); } S32 u8_value = F32_to_U8(value,viewer_param->getMinWeight(),viewer_param->getMaxWeight()); - absl::FPrintF(file, "\t\t<param id=\"%d\" name=\"%s\" display=\"%s\" value=\"%.3f\" u8=\"%d\" type=\"%s\" wearable=\"%s\" group=\"%d\"/>\n", + apr_file_printf(file, "\t\t<param id=\"%d\" name=\"%s\" display=\"%s\" value=\"%.3f\" u8=\"%d\" type=\"%s\" wearable=\"%s\" group=\"%d\"/>\n", viewer_param->getID(), viewer_param->getName().c_str(), viewer_param->getDisplayName().c_str(), value, u8_value, type_string.c_str(), LLWearableType::getTypeName(LLWearableType::EType(wtype)).c_str(), viewer_param->getGroup()); @@ -8822,8 +8822,10 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, const std::vector<F32>& params_for_dump = contents.mParamWeights; const LLTEContents& tec = contents.mTEContents; + LLAPRFile outfile; std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - LLUniqueFile file = LLFile::fopen(fullpath, "wb"); + outfile.open(fullpath, LL_APR_WB ); + apr_file_t* file = outfile.getFileHandle(); if (!file) { return; @@ -8833,12 +8835,12 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << LL_ENDL; } - absl::FPrintF(file, "<header>\n"); - absl::FPrintF(file, "\t\t<cof_version %i />\n", contents.mCOFVersion); - absl::FPrintF(file, "\t\t<appearance_version %i />\n", contents.mAppearanceVersion); - absl::FPrintF(file, "</header>\n"); + apr_file_printf(file, "<header>\n"); + apr_file_printf(file, "\t\t<cof_version %i />\n", contents.mCOFVersion); + apr_file_printf(file, "\t\t<appearance_version %i />\n", contents.mAppearanceVersion); + apr_file_printf(file, "</header>\n"); - absl::FPrintF(file, "\n<params>\n"); + apr_file_printf(file, "\n<params>\n"); LLVisualParam* param = getFirstVisualParam(); for (S32 i = 0; i < params_for_dump.size(); i++) { @@ -8852,16 +8854,16 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, dump_visual_param(file, viewer_param, value); param = getNextVisualParam(); } - absl::FPrintF(file, "</params>\n"); + apr_file_printf(file, "</params>\n"); - absl::FPrintF(file, "\n<textures>\n"); + apr_file_printf(file, "\n<textures>\n"); for (U32 i = 0; i < tec.face_count; i++) { std::string uuid_str; ((LLUUID*)tec.image_data)[i].toString(uuid_str); - absl::FPrintF( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str()); + apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str()); } - absl::FPrintF(file, "</textures>\n"); + apr_file_printf(file, "</textures>\n"); } void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) @@ -9584,14 +9586,14 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLAPRFile outfile; std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - LLUniqueFile file = LLFile::fopen(fullpath, "wb"); - if (file) + if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB )) { + apr_file_t* file = outfile.getFileHandle(); LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL; - absl::FPrintF( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); - absl::FPrintF( file, "<linden_genepool version=\"1.0\">\n" ); - absl::FPrintF( file, "\n\t<archetype name=\"???\">\n" ); + apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); + apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); + apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); bool agent_is_godlike = gAgent.isGodlikeWithoutAdminMenuFakery(); @@ -9600,7 +9602,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) { const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); - absl::FPrintF( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); + apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) { @@ -9625,7 +9627,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara { te_image->getID().toString(uuid_str); } - absl::FPrintF( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); + apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); } } } @@ -9651,7 +9653,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara { te_image->getID().toString(uuid_str); } - absl::FPrintF( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); + apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); } } } @@ -9659,7 +9661,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara // Root joint const LLVector3& pos = mRoot->getPosition(); const LLVector3& scale = mRoot->getScale(); - absl::FPrintF( file, "\t\t<root name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", + apr_file_printf( file, "\t\t<root name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", mRoot->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); // Bones @@ -9677,7 +9679,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLJoint *pJoint = getJoint(*name_iter); const LLVector3& pos = pJoint->getPosition(); const LLVector3& scale = pJoint->getScale(); - absl::FPrintF( file, "\t\t<bone name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", + apr_file_printf( file, "\t\t<bone name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); } @@ -9688,7 +9690,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLJoint *pJoint = getJoint(*name_iter); const LLVector3& pos = pJoint->getPosition(); const LLVector3& scale = pJoint->getScale(); - absl::FPrintF( file, "\t\t<collision_volume name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", + apr_file_printf( file, "\t\t<collision_volume name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); } @@ -9700,7 +9702,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara if (!pJoint) continue; const LLVector3& pos = pJoint->getPosition(); const LLVector3& scale = pJoint->getScale(); - absl::FPrintF( file, "\t\t<attachment_point name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", + apr_file_printf( file, "\t\t<attachment_point name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); } @@ -9718,7 +9720,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara S32 num_pos_overrides; std::set<LLVector3> distinct_pos_overrides; pJoint->getAllAttachmentPosOverrides(num_pos_overrides, distinct_pos_overrides); - absl::FPrintF( file, "\t\t<joint_offset name=\"%s\" position=\"%f %f %f\" mesh_id=\"%s\" count=\"%d\" distinct=\"%d\"/>\n", + apr_file_printf( file, "\t\t<joint_offset name=\"%s\" position=\"%f %f %f\" mesh_id=\"%s\" count=\"%d\" distinct=\"%d\"/>\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str(), num_pos_overrides, (S32) distinct_pos_overrides.size()); } @@ -9737,7 +9739,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara S32 num_scale_overrides; std::set<LLVector3> distinct_scale_overrides; pJoint->getAllAttachmentPosOverrides(num_scale_overrides, distinct_scale_overrides); - absl::FPrintF( file, "\t\t<joint_scale name=\"%s\" scale=\"%f %f %f\" mesh_id=\"%s\" count=\"%d\" distinct=\"%d\"/>\n", + apr_file_printf( file, "\t\t<joint_scale name=\"%s\" scale=\"%f %f %f\" mesh_id=\"%s\" count=\"%d\" distinct=\"%d\"/>\n", pJoint->getName().c_str(), scale[0], scale[1], scale[2], mesh_id.asString().c_str(), num_scale_overrides, (S32) distinct_scale_overrides.size()); } @@ -9746,7 +9748,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLUUID mesh_id; if (hasPelvisFixup(pelvis_fixup, mesh_id)) { - absl::FPrintF( file, "\t\t<pelvis_fixup z=\"%f\" mesh_id=\"%s\"/>\n", + apr_file_printf( file, "\t\t<pelvis_fixup z=\"%f\" mesh_id=\"%s\"/>\n", pelvis_fixup, mesh_id.asString().c_str()); } @@ -9769,7 +9771,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLVector4a rrp[2]; rrp[0].setSub(new_extents[0],rpv); rrp[1].setSub(new_extents[1],rpv); - absl::FPrintF( file, "\t\t<joint_rig_info num=\"%d\" name=\"%s\" min=\"%f %f %f\" max=\"%f %f %f\" tmin=\"%f %f %f\" tmax=\"%f %f %f\"/>\n", + apr_file_printf( file, "\t\t<joint_rig_info num=\"%d\" name=\"%s\" min=\"%f %f %f\" max=\"%f %f %f\" tmin=\"%f %f %f\" tmax=\"%f %f %f\"/>\n", joint_num, joint->getName().c_str(), rig_info.getRiggedExtents()[0][0], @@ -9792,11 +9794,11 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara if (isSelf() && ultra_verbose) { // show the cloned params inside the wearables as well. - gAgentAvatarp->dumpWearableInfo(file); + gAgentAvatarp->dumpWearableInfo(outfile); } - absl::FPrintF( file, "\t</archetype>\n" ); - absl::FPrintF( file, "\n</linden_genepool>\n" ); + apr_file_printf( file, "\t</archetype>\n" ); + apr_file_printf( file, "\n</linden_genepool>\n" ); LLSD args; args["PATH"] = fullpath; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 278e834a69e..1acb9401f1d 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -1126,7 +1126,7 @@ extern const F32 MIN_HOVER_Z; std::string get_sequential_numbered_file_name(const std::string& prefix, const std::string& suffix); void dump_sequential_xml(const std::string outprefix, const LLSD& content); -void dump_visual_param(LLFILE* file, LLVisualParam* viewer_param, F32 value); +void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); #endif // LL_VOAVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index cf554acf85e..005118f896f 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2902,15 +2902,16 @@ void LLVOAvatarSelf::dumpScratchTextureByteCount() LL_INFOS() << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << LL_ENDL; } -void LLVOAvatarSelf::dumpWearableInfo(LLFILE* file) +void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile) { + apr_file_t* file = outfile.getFileHandle(); if (!file) { return; } - absl::FPrintF( file, "\n<wearable_info>\n" ); + apr_file_printf( file, "\n<wearable_info>\n" ); LLWearableData *wd = getWearableData(); for (S32 type = 0; type < LLWearableType::WT_COUNT; type++) @@ -2919,7 +2920,7 @@ void LLVOAvatarSelf::dumpWearableInfo(LLFILE* file) for (U32 j=0; j< wd->getWearableCount((LLWearableType::EType)type); j++) { LLViewerWearable *wearable = gAgentWearables.getViewerWearable((LLWearableType::EType)type,j); - absl::FPrintF( file, "\n\t <wearable type=\"%s\" name=\"%s\"/>\n", + apr_file_printf( file, "\n\t <wearable type=\"%s\" name=\"%s\"/>\n", type_name.c_str(), wearable->getName().c_str() ); LLWearable::visual_param_vec_t v_params; wearable->getVisualParams(v_params); @@ -2931,7 +2932,7 @@ void LLVOAvatarSelf::dumpWearableInfo(LLFILE* file) } } } - absl::FPrintF( file, "\n</wearable_info>\n" ); + apr_file_printf( file, "\n</wearable_info>\n" ); } //// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 58677c76df5..4d01a685dcc 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -353,7 +353,7 @@ class LLVOAvatarSelf final : static void dumpTotalLocalTextureByteCount(); void dumpLocalTextures() const; static void dumpScratchTextureByteCount(); - void dumpWearableInfo(LLFILE* outfile); + void dumpWearableInfo(LLAPRFile& outfile); //-------------------------------------------------------------------- // Avatar Rez Metrics -- GitLab