删了很多无效的代码

master
caiyuzheng 2020-09-14 00:28:29 +08:00
parent 92bc997726
commit 762bd76fed
8 changed files with 73 additions and 292 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ src/net/新建文本文档.txt
cmake-build-debug/
.idea/
build/
.vs/

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/general">
<contentRoot DIR="$PROJECT_DIR$" />
</component>
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/General.iml" filepath="$PROJECT_DIR$/.idea/General.iml" />
</modules>
</component>
</project>

View File

@ -1,203 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select />
</component>
<component name="CMakeRunConfigurationManager" shouldGenerate="true" shouldDeleteObsolete="true">
<generated>
<config projectName="General" targetName="General" />
</generated>
</component>
<component name="CMakeSettings" AUTO_RELOAD="true">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ChangeListManager">
<list default="true" id="0facce0d-c642-4d80-b2fb-daf5f3e68dff" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/general/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/general/CMakeLists.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/general/src/pattern/cmd.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/general/src/pattern/cmd.hpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ClangdSettings">
<option name="formatViaClangd" value="false" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="CMakeBuildProfile:Debug" />
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="CMakeLists.txt" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="OCFindUsagesOptions" text="true" ivars="false" properties="true" derivedClasses="false" />
<component name="OCResolveContextSettings">
<option name="configuration" value="0-generallib" />
</component>
<component name="ProjectId" id="1UhntPy4Y6cJ81thpskTMk9Asng" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="cf.first.check.clang-format" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="D:\project\c++\generallib\general\src\ b-+" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\project\c++\generallib\src\encrypt" />
</key>
</component>
<component name="RunManager">
<configuration name="General" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="General" TARGET_NAME="General" CONFIG_NAME="Debug">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="0facce0d-c642-4d80-b2fb-daf5f3e68dff" name="Default Changelist" comment="" />
<created>1575817908178</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1575817908178</updated>
<workItem from="1575817909426" duration="3242000" />
<workItem from="1575898054796" duration="4350000" />
<workItem from="1576304090241" duration="2459000" />
<workItem from="1576585606642" duration="7534000" />
<workItem from="1576913674335" duration="7707000" />
<workItem from="1576932562738" duration="10349000" />
<workItem from="1576983828513" duration="3804000" />
<workItem from="1577012242357" duration="1291000" />
<workItem from="1577695713801" duration="735000" />
<workItem from="1577715047417" duration="4424000" />
<workItem from="1577775991319" duration="2037000" />
<workItem from="1577933629796" duration="16000" />
<workItem from="1577933660908" duration="635000" />
<workItem from="1578153114620" duration="4070000" />
<workItem from="1578225965728" duration="1215000" />
<workItem from="1578280389789" duration="13088000" />
<workItem from="1578361985988" duration="3323000" />
<workItem from="1578460910091" duration="1945000" />
<workItem from="1578906765061" duration="6062000" />
<workItem from="1579014632931" duration="2670000" />
<workItem from="1580217628266" duration="1481000" />
<workItem from="1580474352803" duration="77000" />
<workItem from="1580647916171" duration="1188000" />
<workItem from="1580657914602" duration="599000" />
<workItem from="1581305036574" duration="7128000" />
<workItem from="1581558579086" duration="643000" />
<workItem from="1583501235151" duration="617000" />
<workItem from="1584890523991" duration="223000" />
<workItem from="1585674715896" duration="786000" />
<workItem from="1585735060761" duration="2165000" />
<workItem from="1585797079455" duration="1848000" />
<workItem from="1587146367315" duration="1596000" />
<workItem from="1587183781038" duration="13107000" />
<workItem from="1587266163206" duration="2365000" />
<workItem from="1587349363612" duration="16126000" />
<workItem from="1587473284944" duration="44000" />
<workItem from="1587473352763" duration="6395000" />
<workItem from="1587651371301" duration="5897000" />
<workItem from="1587713244566" duration="10654000" />
<workItem from="1588607501663" duration="599000" />
<workItem from="1588685364145" duration="2436000" />
<workItem from="1588731711427" duration="7486000" />
<workItem from="1588756178008" duration="9322000" />
<workItem from="1588780515188" duration="1174000" />
<workItem from="1588781713713" duration="809000" />
<workItem from="1588924890957" duration="190000" />
<workItem from="1588937000080" duration="6169000" />
<workItem from="1589005894180" duration="10282000" />
<workItem from="1589079851627" duration="4745000" />
<workItem from="1589096335715" duration="9622000" />
<workItem from="1589465397742" duration="4077000" />
<workItem from="1590041861831" duration="3306000" />
<workItem from="1590548574620" duration="180000" />
<workItem from="1590676222894" duration="3290000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="2" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="WindowStateProjectService">
<state x="361" y="110" key="#New_File_Extensions" timestamp="1589793685936">
<screen x="0" y="40" width="1536" height="824" />
</state>
<state x="361" y="110" key="#New_File_Extensions/0.40.1536.824@0.40.1536.824" timestamp="1589793685936" />
<state x="651" y="314" width="409" height="388" key="#Notifications" timestamp="1588741195489">
<screen x="0" y="40" width="1536" height="824" />
</state>
<state x="651" y="314" width="409" height="388" key="#Notifications/0.40.1536.824@0.40.1536.824" timestamp="1588741195489" />
<state x="223" y="107" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1588731831415">
<screen x="0" y="40" width="1536" height="824" />
</state>
<state x="223" y="107" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.40.1536.824@0.40.1536.824" timestamp="1588731831415" />
<state x="549" y="206" key="FileChooserDialogImpl" timestamp="1588739069638">
<screen x="0" y="40" width="1536" height="824" />
</state>
<state x="549" y="206" key="FileChooserDialogImpl/0.40.1536.824@0.40.1536.824" timestamp="1588739069638" />
<state x="270" y="96" key="SettingsEditor" timestamp="1588739395688">
<screen x="0" y="40" width="1536" height="824" />
</state>
<state x="270" y="96" key="SettingsEditor/0.40.1536.824@0.40.1536.824" timestamp="1588739395688" />
</component>
</project>

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.10)
project(generallib)
add_subdirectory(general)
SET(SRC_SDK sdk_main.c test/src/heapsort/main.c)#
SET(SRC_SDK sdk_main.c test/src/heapsort/main.c)
add_library(generallib STATIC $<TARGET_OBJECTS:General> ${SRC_SDK})
link_directories(general/third/lib)
set_target_properties(generallib PROPERTIES LINKER_LANGUAGE CXX)

View File

@ -3,29 +3,32 @@
//
#include "utils.h"
string itos(int x){
string itos(int x)
{
char buf[100] = {0};
itoa(x, buf, 10);
return string(buf);
}
inline ENV_SYS CurrentEnvSys(){
inline ENV_SYS CurrentEnvSys()
{
#ifdef linux
return ENV_LINUX
return ENV_LINUX;
#endif
#ifdef _WINDOWS
return ENV_WINDOWS
return ENV_WINDOWS;
#endif
#ifdef _UNIX
return ENV_UNIX
return ENV_UNIX;
#endif
#ifdef _WIN32
return ENV_WINDOWS
return ENV_WINDOWS;
#endif
return ENV_NONE;
}
inline ENV_COMPILER CurrentEnvCompiler(){
inline ENV_COMPILER CurrentEnvCompiler()
{
#ifdef __GNUC__
return GCC;
#endif

View File

@ -95,13 +95,11 @@ static void maxheap_filterup(int start)
if (m_heap[p] >= tmp)
break;
else
<<<<<<< Updated upstream
{ // 父节点小于当前节点,就调换位置,当前节点作为父节点,来源于一个抢位置的概念
== == == =
{ // 父节点小于当前节点,就调换位置,当前节点的值变成父节点的值,父节点的值变成当前节点的值,
// 并且父节点接着和父节点的父节点进行比较,如果还是比父节点的值大,再次把发当前节点的值
//
>>>>>>> Stashed changes
m_heap[c] = m_heap[p];
c = p;
p = (p - 1) / 2; // 再把当前节点和上一个父节点在比较大小
@ -146,7 +144,8 @@ void main()
printf("%d \r\n", a[i]);
maxheap_insert(a[i]);
printf("round %d result:\r\n");
for(uint8_t z = 0;z < m_size;z++) {
for (uint8_t z = 0; z < m_size; z++)
{
printf("%d\r\n", m_heap[z]);
}
printf("end\r\n");