From a1171f15240b5b51d14a580242da26e244bb3504 Mon Sep 17 00:00:00 2001 From: xerox Date: Tue, 10 Nov 2020 11:49:17 -0800 Subject: [PATCH] removed useless braces.. --- nasa-tables/mem_ctx/mem_ctx.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/nasa-tables/mem_ctx/mem_ctx.cpp b/nasa-tables/mem_ctx/mem_ctx.cpp index 7ca9467..f8c9ca7 100644 --- a/nasa-tables/mem_ctx/mem_ctx.cpp +++ b/nasa-tables/mem_ctx/mem_ctx.cpp @@ -78,32 +78,28 @@ namespace nasa { const auto pml4 = reinterpret_cast( - set_page(dirbase)); - - pml4[pml4e_index] = pml4e{ NULL }; + set_page(dirbase))[pml4e_index] = pml4e{ NULL }; } void* mem_ctx::set_page(void* addr) { // table entry change. + ++pte_index; + if (pte_index >= 511) { - ++pte_index; - if (pte_index >= 511) - { - ++pde_index; - pte_index = 0; - } - - if (pde_index >= 511) - { - ++pdpte_index; - pde_index = 0; - } + ++pde_index; + pte_index = 0; + } - if (pdpte_index >= 511) - pdpte_index = 0; + if (pde_index >= 511) + { + ++pdpte_index; + pde_index = 0; } + if (pdpte_index >= 511) + pdpte_index = 0; + pdpte new_pdpte = { NULL }; new_pdpte.present = true; new_pdpte.rw = true;