Add base64url tests, and adapt base64 tests to also use "/".

--- test/test_cppcodec.cpp
+++ test/test_cppcodec.cpp
@@ -289,10 +289,10 @@
         REQUIRE(base64::encode(std::string("any carnal pleasu")) == "YW55IGNhcm5hbCBwbGVhc3U=");
         REQUIRE(base64::encode(std::string("any carnal pleasur")) == "YW55IGNhcm5hbCBwbGVhc3Vy");

-        // RFC 4648: 9. Illustrations and Examples
-        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0x9C, 0x03, 0xD9, 0x7E})) == "FPucA9l+");
-        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0x9C, 0x03, 0xD9})) == "FPucA9k=");
-        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0x9C, 0x03})) == "FPucAw==");
+        // RFC 4648: 9. Illustrations and Examples, adapted for more special characters
+        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9, 0x7E})) == "FPu/A9l+");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9})) == "FPu/A9k=");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03})) == "FPu/Aw==");

         // RFC 4648: 10. Test Vectors
         REQUIRE(base64::encode(std::string("")) == "");
@@ -329,10 +329,10 @@
         REQUIRE(base64::decode<std::string>("YW55IGNhcm5hbCBwbGVhc3U=") == "any carnal pleasu");
         REQUIRE(base64::decode<std::string>("YW55IGNhcm5hbCBwbGVhc3Vy") == "any carnal pleasur");

-        // RFC 4648: 9. Illustrations and Examples
-        REQUIRE(base64::decode("FPucA9l+") == std::vector<uint8_t>({0x14, 0xFB, 0x9C, 0x03, 0xD9, 0x7E}));
-        REQUIRE(base64::decode("FPucA9k=") == std::vector<uint8_t>({0x14, 0xFB, 0x9C, 0x03, 0xD9}));
-        REQUIRE(base64::decode("FPucAw==") == std::vector<uint8_t>({0x14, 0xFB, 0x9C, 0x03}));
+        // RFC 4648: 9. Illustrations and Examples, adapted for more special characters
+        REQUIRE(base64::decode("FPu/A9l+") == std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9, 0x7E}));
+        REQUIRE(base64::decode("FPu/A9k=") == std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9}));
+        REQUIRE(base64::decode("FPu/Aw==") == std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03}));

         // RFC 4648: 10. Test Vectors
         REQUIRE(base64::decode<std::string>("") == "");
@@ -355,3 +355,95 @@
         REQUIRE_THROWS_AS(base64::decode("__"), cppcodec::symbol_error&); // ...ditto
     }
 }
+
+TEST_CASE("base64 (URL-safe)", "[base64][url]") {
+    using base64 = cppcodec::base64_url;
+
+    SECTION("encoded size calculation") {
+        REQUIRE(base64::encoded_size(0) == 0);
+        REQUIRE(base64::encoded_size(1) == 4);
+        REQUIRE(base64::encoded_size(2) == 4);
+        REQUIRE(base64::encoded_size(3) == 4);
+        REQUIRE(base64::encoded_size(4) == 8);
+        REQUIRE(base64::encoded_size(5) == 8);
+        REQUIRE(base64::encoded_size(6) == 8);
+        REQUIRE(base64::encoded_size(7) == 12);
+        REQUIRE(base64::encoded_size(12) == 16);
+    }
+
+    SECTION("maximum decoded size calculation") {
+        REQUIRE(base64::decoded_max_size(0) == 0);
+        REQUIRE(base64::decoded_max_size(1) == 0);
+        REQUIRE(base64::decoded_max_size(2) == 0);
+        REQUIRE(base64::decoded_max_size(3) == 0);
+        REQUIRE(base64::decoded_max_size(4) == 3);
+        REQUIRE(base64::decoded_max_size(5) == 3);
+        REQUIRE(base64::decoded_max_size(6) == 3);
+        REQUIRE(base64::decoded_max_size(7) == 3);
+        REQUIRE(base64::decoded_max_size(8) == 6);
+        REQUIRE(base64::decoded_max_size(9) == 6);
+        REQUIRE(base64::decoded_max_size(10) == 6);
+        REQUIRE(base64::decoded_max_size(11) == 6);
+        REQUIRE(base64::decoded_max_size(12) == 9);
+        REQUIRE(base64::decoded_max_size(16) == 12);
+    }
+
+    SECTION("encoding data") {
+        REQUIRE(base64::encode(std::vector<uint8_t>()) == "");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0})) == "AA==");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0, 0})) == "AAA=");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0, 0, 0})) == "AAAA");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0, 0, 0, 0})) == "AAAAAA==");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0, 0, 0, 0, 0})) == "AAAAAAA=");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0, 0, 0, 0, 0, 0})) == "AAAAAAAA");
+
+        // RFC 4648: 9. Illustrations and Examples, adapted for more special characters
+        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9, 0x7E})) == "FPu_A9l-");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9})) == "FPu_A9k=");
+        REQUIRE(base64::encode(std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03})) == "FPu_Aw==");
+
+        // RFC 4648: 10. Test Vectors
+        REQUIRE(base64::encode(std::string("")) == "");
+        REQUIRE(base64::encode(std::string("f")) == "Zg==");
+        REQUIRE(base64::encode(std::string("fo")) == "Zm8=");
+        REQUIRE(base64::encode(std::string("foo")) == "Zm9v");
+        REQUIRE(base64::encode(std::string("foob")) == "Zm9vYg==");
+        REQUIRE(base64::encode(std::string("fooba")) == "Zm9vYmE=");
+        REQUIRE(base64::encode(std::string("foobar")) == "Zm9vYmFy");
+    }
+
+    SECTION("decoding data") {
+        REQUIRE(base64::decode("") == std::vector<uint8_t>());
+        REQUIRE(base64::decode("AA==") == std::vector<uint8_t>({0}));
+        REQUIRE(base64::decode("AAA=") == std::vector<uint8_t>({0, 0}));
+        REQUIRE(base64::decode("AAAA") == std::vector<uint8_t>({0, 0, 0}));
+        REQUIRE(base64::decode("AAAAAA==") == std::vector<uint8_t>({0, 0, 0, 0}));
+        REQUIRE(base64::decode("AAAAAAA=") == std::vector<uint8_t>({0, 0, 0, 0, 0}));
+        REQUIRE(base64::decode("AAAAAAAA") == std::vector<uint8_t>({0, 0, 0, 0, 0, 0}));
+
+        // RFC 4648: 9. Illustrations and Examples, adapted for more special characters
+        REQUIRE(base64::decode("FPu_A9l-") == std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9, 0x7E}));
+        REQUIRE(base64::decode("FPu_A9k=") == std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03, 0xD9}));
+        REQUIRE(base64::decode("FPu_Aw==") == std::vector<uint8_t>({0x14, 0xFB, 0xBF, 0x03}));
+
+        // RFC 4648: 10. Test Vectors
+        REQUIRE(base64::decode<std::string>("") == "");
+        REQUIRE(base64::decode<std::string>("Zg==") == "f");
+        REQUIRE(base64::decode<std::string>("Zm8=") == "fo");
+        REQUIRE(base64::decode<std::string>("Zm9v") == "foo");
+        REQUIRE(base64::decode<std::string>("Zm9vYg==") == "foob");
+        REQUIRE(base64::decode<std::string>("Zm9vYmE=") == "fooba");
+        REQUIRE(base64::decode<std::string>("Zm9vYmFy") == "foobar");
+
+        // An invalid number of symbols should throw the right kind of parse_error.
+        REQUIRE_THROWS_AS(base64::decode("A"), cppcodec::padding_error&);
+        REQUIRE_THROWS_AS(base64::decode("AA"), cppcodec::padding_error&);
+        REQUIRE_THROWS_AS(base64::decode("A==="), cppcodec::invalid_input_length&);
+        REQUIRE_THROWS_AS(base64::decode("AAAA===="), cppcodec::invalid_input_length&);
+        REQUIRE_THROWS_AS(base64::decode("AAAAA==="), cppcodec::invalid_input_length&);
+
+        // An invalid symbol should throw a symbol error.
+        REQUIRE_THROWS_AS(base64::decode("++"), cppcodec::symbol_error&); // this is not standard base64
+        REQUIRE_THROWS_AS(base64::decode("//"), cppcodec::symbol_error&); // ...ditto
+    }
+}


String to int

String to int

--- Device/RaspberryPi/src/Main.cpp
+++ Device/RaspberryPi/src/Main.cpp
@@ -42,24 +42,25 @@
 //键盘按下
 void handlerKeyDown(struct bufferevent * bufEvent,Json::Value &data){
     Json::Value key_map = data["data"];
-    int key;
-    stringstream stream;
-    stream << key_map["key"].toStyledString();
-    stream >> key;
-    switch(key){
-        case 119://W
-        case 115://S
-        case 97://A
-        case 100://D
-        case 105://I
-        case 107://K
-        case 106://J
-        case 108://L
-            printf("key down:%d\n", key);
-        break;
-        default:
-            printf("key not find:%d\n", key);
-        break;
+    string key = key_map["key"].toStyledString();
+    if(key.compare("119") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else if(key.compare("115") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else if(key.compare("97") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else if(key.compare("100") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else if(key.compare("105") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else if(key.compare("107") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else if(key.compare("106") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else if(key.compare("108") == 0){
+        printf("key down:%s\n", key.c_str());
+    }else{
+        printf("key not find:%s\n", key.c_str());
     }
 }
 //获取MAC地址


update

update

--- Lerngruppe/kgv/main.cpp
+++ Lerngruppe/kgv/main.cpp
@@ -28,13 +28,18 @@
 int kgv(int,int);
 int ggtRek(int,int);

-
 int main()
 {
+
+	auto start = myFunks::myTime::start();
+	std::this_thread::sleep_for (std::chrono::seconds(1));
 	cout<<kgv(12,18)<<endl; //36
+	myFunks::myTime::stop(start);

 	return 0;
 }
+
+

 int kgv(int zahl1, int zahl2)
 {


tested regex code

tested regex code

--- gateway/src/gateway.cpp
+++ gateway/src/gateway.cpp
@@ -917,14 +917,18 @@
 	int size = my_exps.size();
 	//Find matches and prefix keyspaces
 	for (; i < size ;i++){
-		boost::regex exp(my_exps.at(i));
+		boost::regex exp(my_exps.at(i), boost::regex_constants::icase);
 		while(boost::regex_search(start, end, what, exp, flags))
 		{
 			std::string str(what.str());
 			boost::trim(str);
 			vector <string> fields;
+			std::string holder("");
 			boost::split_regex( fields, str, boost::regex( "[ ]{1,}" ) );
-			found = fields[1].find(sys);
+			holder = fields[1];
+			boost::to_lower(holder);
+			boost::to_upper(fields[0]);
+			found = holder.find(sys);
 	                if (found != std::string::npos){
                                 cout << "System table found at pos: " << found << endl;
                                 start = what[0].second;


Minor fix for test_jointGMM.cpp

Minor fix for test_jointGMM.cpp

--- test/test_jointGMM.cpp
+++ test/test_jointGMM.cpp
@@ -96,7 +96,7 @@
 	free(varB);

 	//write three images to disk
-	optImage.writeImage(std::string("jointGMMTestOutput.bmp").c_str());//this is the output file name
+	optImage.writeImage(std::string("jointGMMTestOutputggg.bmp").c_str());//this is the output file name

 	std::cout << "Press any key to finish" << std::endl;
 	getchar();


By default, propagate picked element to its projectable.

--- EVE/alieve_main/alieve_main.cxx
+++ EVE/alieve_main/alieve_main.cxx
@@ -17,6 +17,7 @@

 #include <TEveUtil.h>
 #include <TEveManager.h>
+#include <TEveSelection.h>

 #include <Getline.h>

@@ -56,6 +57,8 @@
   TRint app("App", &argc, argv);

   TEveManager::Create();
+  gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_Projectable);
+  gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_Projectable);

   gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/alice_fullgeo.root", evedir.Data()));


AGS.Native: updated to correspond to changes in Bitmap class

--- Editor/AGS.Native/agsnative.cpp
+++ Editor/AGS.Native/agsnative.cpp
@@ -58,11 +58,11 @@

 inline void Cstretch_blit(Common::Bitmap *src, Common::Bitmap *dst, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh)
 {
-	Cstretch_blit((BITMAP*)src->GetBitmapObject(), (BITMAP*)dst->GetBitmapObject(), sx, sy, sw, sh, dx, dy, dw, dh);
+	Cstretch_blit(src->GetAllegroBitmap(), dst->GetAllegroBitmap(), sx, sy, sw, sh, dx, dy, dw, dh);
 }
 inline void Cstretch_sprite(Common::Bitmap *dst, Common::Bitmap *src, int x, int y, int w, int h)
 {
-	Cstretch_sprite((BITMAP*)dst->GetBitmapObject(), (BITMAP*)src->GetBitmapObject(), x, y, w, h);
+	Cstretch_sprite(dst->GetAllegroBitmap(), src->GetAllegroBitmap(), x, y, w, h);
 }

@@ -110,8 +110,8 @@
 void write_log(char *) { }

 void GUIInv::Draw(Common::Graphics *g) {
-  g->SetColor(15);
-  g->Bmp->DrawRect(Rect(x,y,x+wid,y+hit), g->DrawColor);
+  g->SetDrawColor(15);
+  g->DrawRect(Rect(x,y,x+wid,y+hit));
 }

 int multiply_up_coordinate(int coord)
@@ -188,7 +188,7 @@

 int GetSpriteAsHBitmap(int slot) {
   // FIXME later
-  return (int)convert_bitmap_to_hbitmap((BITMAP*)get_sprite(slot)->GetBitmapObject());
+  return (int)convert_bitmap_to_hbitmap(get_sprite(slot)->GetAllegroBitmap());
 }

 bool DoesSpriteExist(int slot) {
@@ -356,7 +356,8 @@
     Common::Bitmap *sprit = get_sprite(sprites[aa]);
     // create a new, smaller sprite and copy across
 	Common::Bitmap *newsprit = Common::BitmapHelper::CreateBitmap(newWidth, newHeight, sprit->GetColorDepth());
-    newsprit->Blit(sprit, left, top, 0, 0, newWidth, newHeight);
+    Common::Graphics g(newsprit);
+    g.Blit(sprit, left, top, 0, 0, newWidth, newHeight);
     delete sprit;

     spriteset.setNonDiscardable(sprites[aa], newsprit);
@@ -608,8 +609,7 @@

 void wputblock_stretch(Common::Graphics *g, int xpt,int ypt,Common::Bitmap *tblock,int nsx,int nsy) {
   if (bmp_bpp(tblock) != thisgame.color_depth) {
-    Common::Bitmap *tempst=Common::BitmapHelper::CreateBitmap(tblock->GetWidth(),tblock->GetHeight(),thisgame.color_depth*8);
-    tempst->Blit(tblock,0,0,0,0,tblock->GetWidth(),tblock->GetHeight());
+    Common::Bitmap *tempst=Common::BitmapHelper::CreateBitmapCopy(tblock, thisgame.color_depth*8);
     int ww,vv;
     for (ww=0;ww<tblock->GetWidth();ww++) {
       for (vv=0;vv<tblock->GetHeight();vv++) {
@@ -617,10 +617,10 @@
           tempst->PutPixel(ww,vv,tempst->GetMaskColor());
       }
     }
-    g->Bmp->StretchBlt(tempst,RectWH(xpt,ypt,nsx,nsy), Common::kBitmap_Transparency);
+    g->StretchBlt(tempst,RectWH(xpt,ypt,nsx,nsy), Common::kBitmap_Transparency);
     delete tempst;
   }
-  else g->Bmp->StretchBlt(tblock,RectWH(xpt,ypt,nsx,nsy), Common::kBitmap_Transparency);
+  else g->StretchBlt(tblock,RectWH(xpt,ypt,nsx,nsy), Common::kBitmap_Transparency);
 }

 void draw_sprite_compensate(Common::Graphics *g, int sprnum, int atxp, int atyp, int seethru) {
@@ -662,7 +662,7 @@
 void drawBlock (HDC hdc, Common::Bitmap *todraw, int x, int y) {
   set_palette_to_hdc (hdc, palette);
   // FIXME later
-  blit_to_hdc ((BITMAP*)todraw->GetBitmapObject(), hdc, 0,0,x,y,todraw->GetWidth(),todraw->GetHeight());
+  blit_to_hdc (todraw->GetAllegroBitmap(), hdc, 0,0,x,y,todraw->GetWidth(),todraw->GetHeight());
 }

@@ -704,7 +704,8 @@

 void copy_walkable_to_regions (void *roomptr) {
 	roomstruct *theRoom = (roomstruct*)roomptr;
-	theRoom->regions->Blit(theRoom->walls, 0, 0, 0, 0, theRoom->regions->GetWidth(), theRoom->regions->GetHeight());
+    Common::Graphics g(theRoom->walls);
+	g.Blit(theRoom->walls, 0, 0, 0, 0, theRoom->regions->GetWidth(), theRoom->regions->GetHeight());
 }

 int get_mask_pixel(void *roomptr, int maskType, int x, int y)
@@ -716,19 +717,22 @@
 void draw_line_onto_mask(void *roomptr, int maskType, int x1, int y1, int x2, int y2, int color)
 {
 	Common::Bitmap *mask = get_bitmap_for_mask((roomstruct*)roomptr, (RoomAreaMask)maskType);
-	mask->DrawLine(Line(x1, y1, x2, y2), color);
+	Common::Graphics g(mask);
+	g.DrawLine(Line(x1, y1, x2, y2), color);
 }

 void draw_filled_rect_onto_mask(void *roomptr, int maskType, int x1, int y1, int x2, int y2, int color)
 {
 	Common::Bitmap *mask = get_bitmap_for_mask((roomstruct*)roomptr, (RoomAreaMask)maskType);
-	mask->FillRect(Rect(x1, y1, x2, y2), color);
+	Common::Graphics g(mask);
+    g.FillRect(Rect(x1, y1, x2, y2), color);
 }

 void draw_fill_onto_mask(void *roomptr, int maskType, int x1, int y1, int color)
 {
 	Common::Bitmap *mask = get_bitmap_for_mask((roomstruct*)roomptr, (RoomAreaMask)maskType);
-	mask->FloodFill(x1, y1, color);
+	Common::Graphics g(mask);
+    g.FloodFill(x1, y1, color);
 }

 void create_undo_buffer(void *roomptr, int maskType)
@@ -746,7 +750,8 @@
   {
     undoBuffer = Common::BitmapHelper::CreateBitmap(mask->GetWidth(), mask->GetHeight(), mask->GetColorDepth());
   }
-  undoBuffer->Blit(mask, 0, 0, 0, 0, mask->GetWidth(), mask->GetHeight());
+  Common::Graphics g(undoBuffer);
+  g.Blit(mask, 0, 0, 0, 0, mask->GetWidth(), mask->GetHeight());
 }

 bool does_undo_buffer_exist()
@@ -768,7 +773,8 @@
   if (does_undo_buffer_exist())
   {
   	Common::Bitmap *mask = get_bitmap_for_mask((roomstruct*)roomptr, (RoomAreaMask)maskType);
-    mask->Blit(undoBuffer, 0, 0, 0, 0, mask->GetWidth(), mask->GetHeight());
+    Common::Graphics g(mask);
+    g.Blit(undoBuffer, 0, 0, 0, 0, mask->GetWidth(), mask->GetHeight());
   }
 }

@@ -832,7 +838,8 @@
     if ((source->GetWidth() != destination->GetWidth()) || (source->GetHeight() != destination->GetHeight()))
     {
 		  stretchedSprite = recycle_bitmap(stretchedSprite, source->GetColorDepth(), destination->GetWidth(), destination->GetHeight());
-		  stretchedSprite->StretchBlt(source, RectWH(0, 0, source->GetWidth(), source->GetHeight()),
+          Common::Graphics g(stretchedSprite);
+		  g.StretchBlt(source, RectWH(0, 0, source->GetWidth(), source->GetHeight()),
 			  RectWH(0, 0, stretchedSprite->GetWidth(), stretchedSprite->GetHeight()));
       sourceSprite = stretchedSprite;
     }
@@ -849,15 +856,18 @@
       int oldColorConv = get_color_conversion();
       set_color_conversion(oldColorConv | COLORCONV_KEEP_TRANS);

-      srcAtRightColDep->Blit(sourceSprite, 0, 0, 0, 0, sourceSprite->GetWidth(), sourceSprite->GetHeight());
+      Common::Graphics g(srcAtRightColDep);
+      g.Blit(sourceSprite, 0, 0, 0, 0, sourceSprite->GetWidth(), sourceSprite->GetHeight());
       set_trans_blender(0, 0, 0, (100 - transparency) + 155);
-      destination->TransBlendBlt(srcAtRightColDep, 0, 0);
+      g.SetBitmap(destination);
+      g.TransBlendBlt(srcAtRightColDep, 0, 0);

       set_color_conversion(oldColorConv);
     }
     else
     {
-		destination->Blit(sourceSprite, 0, 0, Common::kBitmap_Transparency);
+        Common::Graphics g(destination);
+		g.Blit(sourceSprite, 0, 0, Common::kBitmap_Transparency);
     }

     set_palette(palette);
@@ -887,7 +897,8 @@
       select_palette(roomptr->bpalettes[bgnum]);
     }

-		depthConverted->Blit(srcBlock, 0, 0, 0, 0, srcBlock->GetWidth(), srcBlock->GetHeight());
+    Common::Graphics g(depthConverted);
+    g.Blit(srcBlock, 0, 0, 0, 0, srcBlock->GetWidth(), srcBlock->GetHeight());

     if (srcBlock->GetColorDepth() == 8)
     {
@@ -1041,7 +1052,7 @@
   // it to crash ... why?
   Common::Bitmap *tempblock = Common::BitmapHelper::CreateBitmap(FONTGRIDSIZE*10, FONTGRIDSIZE*10, 8);
   Common::Graphics graphics(tempblock);
-  graphics.Bmp->Clear(0);
+  graphics.Fill(0);
   //Common::Bitmap *abufwas = abuf;
   //abuf = tempblock;
   graphics.SetTextColor(15);
@@ -1095,7 +1106,8 @@
       // 256-col sprite in hi-col game, we need to copy first
       Common::Bitmap *oldBlt = toblt;
       toblt = Common::BitmapHelper::CreateBitmap (toblt->GetWidth(), toblt->GetHeight(), todraw->GetColorDepth ());
-      toblt->Blit (oldBlt, 0, 0, 0, 0, oldBlt->GetWidth(), oldBlt->GetHeight());
+      Common::Graphics g(toblt);
+      g.Blit (oldBlt, 0, 0, 0, 0, oldBlt->GetWidth(), oldBlt->GetHeight());
       freeBlock = true;
     }
     Common::Bitmap *flipped = NULL;
@@ -1103,7 +1115,8 @@
       // mirror the sprite
       flipped = Common::BitmapHelper::CreateBitmap (toblt->GetWidth(), toblt->GetHeight(), todraw->GetColorDepth ());
       flipped->Clear (flipped->GetMaskColor ());
-      flipped->FlipBlt(toblt, 0, 0, Common::kBitmap_HFlip);
+      Common::Graphics g(flipped);
+      g.FlipBlt(toblt, 0, 0, Common::kBitmap_HFlip);
       if (freeBlock)
         delete toblt;
       toblt = flipped;
@@ -1113,13 +1126,14 @@
 	Cstretch_sprite(todraw, toblt, size*i, 0, neww, newh);
     if (freeBlock)
       delete toblt;
+    Common::Graphics g(todraw);
     if (i < numFrames-1) {
       int linecol = makecol_depth(thisgame.color_depth * 8, 0, 64, 200);
       if (thisgame.color_depth == 1)
         linecol = 12;

       // Draw dividing line
-	  todraw->DrawLine (Line(size*(i+1) - 1, 0, size*(i+1) - 1, size-1), linecol);
+	  g.DrawLine (Line(size*(i+1) - 1, 0, size*(i+1) - 1, size-1), linecol);
     }
     if (i == cursel) {
       // Selected item
@@ -1127,7 +1141,7 @@
       if (thisgame.color_depth == 1)
         linecol = 14;

-      todraw->DrawRect(Rect (size * i, 0, size * (i+1) - 1, size-1), linecol);
+      g.DrawRect(Rect (size * i, 0, size * (i+1) - 1, size-1), linecol);
     }
   }
   drawBlock ((HDC)hdc, todraw, x, y);
@@ -1237,7 +1251,7 @@
     set_palette_to_hdc ((HDC)hdc, palette);

   // FIXME later
-  stretch_blit_to_hdc ((BITMAP*)todraw->GetBitmapObject(), (HDC)hdc, 0,0,todraw->GetWidth(),todraw->GetHeight(),
+  stretch_blit_to_hdc (todraw->GetAllegroBitmap(), (HDC)hdc, 0,0,todraw->GetWidth(),todraw->GetHeight(),
     x,y,todraw->GetWidth() * scaleFactor, todraw->GetHeight() * scaleFactor);
 }

@@ -1250,8 +1264,9 @@

 	if (flipImage) {
 		Common::Bitmap *flipped = Common::BitmapHelper::CreateBitmap (theSprite->GetWidth(), theSprite->GetHeight(), theSprite->GetColorDepth());
-		flipped->Clear (flipped->GetMaskColor ());
-		flipped->FlipBlt(theSprite, 0, 0, Common::kBitmap_HFlip);
+        Common::Graphics g(flipped);
+		g.Fill (flipped->GetMaskColor ());
+		g.FlipBlt(theSprite, 0, 0, Common::kBitmap_HFlip);
 		drawBlockScaledAt(hdc, flipped, x, y, scaleFactor);
 		delete flipped;
 	}
@@ -1271,13 +1286,12 @@
   int hdcBpp = GetDeviceCaps((HDC)hdc, BITSPIXEL);
   if (hdcBpp != todraw->GetColorDepth())
   {
-	  tempBlock = Common::BitmapHelper::CreateBitmap(todraw->GetWidth(), todraw->GetHeight(), hdcBpp);
-	  tempBlock->Blit(todraw, 0, 0, 0, 0, todraw->GetWidth(), todraw->GetHeight());
+	  tempBlock = Common::BitmapHelper::CreateBitmapCopy(todraw, hdcBpp);
 	  todraw = tempBlock;
   }

   // FIXME later
-  stretch_blit_to_hdc ((BITMAP*)todraw->GetBitmapObject(), (HDC)hdc, 0,0,todraw->GetWidth(),todraw->GetHeight(), x,y, width, height);
+  stretch_blit_to_hdc (todraw->GetAllegroBitmap(), (HDC)hdc, 0,0,todraw->GetWidth(),todraw->GetHeight(), x,y, width, height);

   delete tempBlock;
 }
@@ -1304,7 +1318,7 @@
   dsc_want_hires = 0;

   if (x1 >= 0) {
-    graphics.Bmp->DrawRect(Rect (x1, y1, x2, y2), 14);
+    graphics.DrawRect(Rect (x1, y1, x2, y2), 14);
   }
   //abuf = abufWas;

@@ -1922,8 +1936,9 @@
     // resize it up to 640x400-res
     int oldw = thisroom.object->GetWidth(), oldh=thisroom.object->GetHeight();
     Common::Bitmap *tempb = Common::BitmapHelper::CreateBitmap(thisroom.width, thisroom.height, thisroom.object->GetColorDepth());
-    tempb->Clear();
-    tempb->StretchBlt(thisroom.object,RectWH(0,0,oldw,oldh),RectWH(0,0,tempb->GetWidth(),tempb->GetHeight()));
+    Common::Graphics g(tempb);
+    g.Fill(0);
+    g.StretchBlt(thisroom.object,RectWH(0,0,oldw,oldh),RectWH(0,0,tempb->GetWidth(),tempb->GetHeight()));
     delete thisroom.object;
     thisroom.object = tempb;
   }
@@ -2663,8 +2678,7 @@
 	{
 		int oldColorConv = get_color_conversion();
 		set_color_conversion(oldColorConv | COLORCONV_KEEP_TRANS);
-		Common::Bitmap *depthConverted = Common::BitmapHelper::CreateBitmap(todraw->GetWidth(), todraw->GetHeight(), drawBuffer->GetColorDepth());
-		depthConverted->Blit(todraw, 0, 0, 0, 0, todraw->GetWidth(), todraw->GetHeight());
+		Common::Bitmap *depthConverted = Common::BitmapHelper::CreateBitmapCopy(todraw, drawBuffer->GetColorDepth());
 		set_color_conversion(oldColorConv);

 		imageToDraw = depthConverted;
@@ -2678,14 +2692,16 @@
 		if (scaleFactor > 1)
 		{
 			Common::Bitmap *resizedImage = Common::BitmapHelper::CreateBitmap(drawWidth, drawHeight, imageToDraw->GetColorDepth());
-			resizedImage->StretchBlt(imageToDraw, RectWH(0, 0, imageToDraw->GetWidth(), imageToDraw->GetHeight()),
+            Common::Graphics g(resizedImage);
+			g.StretchBlt(imageToDraw, RectWH(0, 0, imageToDraw->GetWidth(), imageToDraw->GetHeight()),
 				RectWH(0, 0, resizedImage->GetWidth(), resizedImage->GetHeight()));
 			if (imageToDraw != todraw)
 				delete imageToDraw;
 			imageToDraw = resizedImage;
 		}
 		set_alpha_blender();
-		drawBuffer->TransBlendBlt(imageToDraw, x, y);
+        Common::Graphics g(drawBuffer);
+		g.TransBlendBlt(imageToDraw, x, y);
 	}
 	else
 	{
@@ -2698,7 +2714,7 @@

 void RenderBufferToHDC(int hdc)
 {
-	blit_to_hdc((BITMAP*)drawBuffer->GetBitmapObject(), (HDC)hdc, 0, 0, 0, 0, drawBuffer->GetWidth(), drawBuffer->GetHeight());
+	blit_to_hdc(drawBuffer->GetAllegroBitmap(), (HDC)hdc, 0, 0, 0, 0, drawBuffer->GetWidth(), drawBuffer->GetHeight());
 	delete drawBuffer;
 	drawBuffer = NULL;
 }
@@ -2894,7 +2910,8 @@
 			set_color_conversion(oldColorConv & ~COLORCONV_KEEP_TRANS);
 		}

-		spriteAtRightDepth->Blit(tempsprite, 0, 0, 0, 0, tempsprite->GetWidth(), tempsprite->GetHeight());
+        Common::Graphics g(spriteAtRightDepth);
+		g.Blit(tempsprite, 0, 0, 0, 0, tempsprite->GetWidth(), tempsprite->GetHeight());

 		set_color_conversion(oldColorConv);

@@ -3010,7 +3027,8 @@
 	}
 	else
 	{
-		mask->Blit(importedImage, 0, 0, 0, 0, importedImage->GetWidth(), importedImage->GetHeight());
+        Common::Graphics g(mask);
+		g.Blit(importedImage, 0, 0, 0, 0, importedImage->GetWidth(), importedImage->GetHeight());
 	}
 	delete importedImage;

@@ -3135,7 +3153,8 @@
   if (todraw->GetColorDepth() == 8)
     select_palette(palette);

-  tempBlock->Blit(todraw, 0, 0, 0, 0, todraw->GetWidth(), todraw->GetHeight());
+  Common::Graphics g(tempBlock);
+  g.Blit(todraw, 0, 0, 0, 0, todraw->GetWidth(), todraw->GetHeight());

   if (todraw->GetColorDepth() == 8)
 	unselect_palette();


Test case changed

Test case changed

--- EstructurasJerarquicas/Main.cpp
+++ EstructurasJerarquicas/Main.cpp
@@ -48,7 +48,11 @@
     post.insertar(10,12);

     BinaryTree<int> tree(pre, in, preorden);
-    BinaryTree<int> tree2(post, in, postorden);
+
+    BinaryTree<int> tree2 = tree.getRight();
+
+    tree2.print(preorden);
+

     return 0;
 }


Path to data file changed.

Path to data file changed.

--- FASTSIM/AliMUONFastTracking.cxx
+++ FASTSIM/AliMUONFastTracking.cxx
@@ -15,6 +15,9 @@

 /*
 $Log$
+Revision 1.1  2003/01/06 10:13:33  morsch
+First commit.
+
 */

 #include "AliMUONFastTracking.h"
@@ -108,7 +111,7 @@
   }

   char filename [100];
-  sprintf (filename,"$(ALICE_ROOT)/data/MUONtrackLUT.root");
+  sprintf (filename,"$(ALICE_ROOT)/FASTSIM/data/MUONtrackLUT.root");
   TFile *file = new TFile(filename);
   ReadLUT(file);
   SetBackground(bkg);


Fix camera lurch on unfocused click and drag


INTEGRATION: CWS changefileheader (1.14.16); FILE MERGED 2008/04/01 15:40:08 thb 1.14.16.3: #i85898# Stripping all external header guards 2008/04/01 12:41:09 thb 1.14.16.2: #i85898# Stripping all external header guards 2008/03/31 13:17:07 rt 1.14.16.1: #i87441# Change license header to LPGL v3.

--- shell/source/backends/gconfbe/gconflayer.cxx
+++ shell/source/backends/gconfbe/gconflayer.cxx
@@ -1,76 +1,48 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
- *
- *  $RCSfile: gconflayer.cxx,v $
- *
- *  $Revision: 1.14 $
- *
- *  last change: $Author: ihi $ $Date: 2008-02-04 13:58:36 $
- *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
- *
- *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: gconflayer.cxx,v $
+ * $Revision: 1.15 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_shell.hxx"
-#ifndef GCONFLAYER_HXX_
 #include "gconflayer.hxx"
-#endif
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_PROPERTYINFO_HPP_
 #include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#endif

 #ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
 #include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
 #endif
-
-#ifndef _RTL_STRBUF_HXX_
 #include <rtl/strbuf.hxx>
-#endif
-
-#ifndef _RTL_USTRBUF_HXX_
 #include <rtl/ustrbuf.hxx>
-#endif
-
-#ifndef _OSL_SECURITY_HXX_
 #include <osl/security.hxx>
-#endif
-
-#ifndef _OSL_FILE_HXX_
 #include <osl/file.hxx>
-#endif
-
-#ifndef _OSL_THREAD_H_
 #include <osl/thread.h>
-#endif
-
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
 #include <com/sun/star/uno/Sequence.hxx>
-#endif

 #include <string.h>


fix shell build with Win8 SDK

fix shell build with Win8 SDK

Change-Id: I19d39f26732772f274e6c8fd76326c50fd73baa3

--- shell/source/win32/simplemail/simplemapi.hxx
+++ shell/source/win32/simplemail/simplemapi.hxx
@@ -27,7 +27,9 @@
 #include <windows.h>
 #include <mapi.h>
 #ifndef __MINGW32__
+#if NTDDI_VERSION < NTDDI_WIN8
 #include <mapix.h>
+#endif
 #endif
 #if defined _MSC_VER
 #pragma warning(pop)


Fix stack_size problem

Fix stack_size problem

Signed-off-by: Suzuki Kojiro <baa11c963256f8a49390a0254ce7c0de828b9a8a@gmail.com>

--- include/kumori/sync.hpp
+++ include/kumori/sync.hpp
@@ -11,7 +11,8 @@
 		sync(boost::asio::io_service& service, const std::function<void()>& entry_point, std::size_t stack_size)
 			: entry_point_(entry_point)
 			, timer_(service)
-			, context_(&sync::callback)
+			, stack_(stack_size)
+			, context_(std::allocator_arg_t(), stack_, &sync::callback)
 		{
 		}

@@ -108,6 +109,8 @@
 		boost::asio::deadline_timer timer_;
 		std::atomic<bool> interrupted_{ false };

+		boost::context::protected_fixedsize_stack stack_;
+
 		boost::context::execution_context<sync*> context_;
 		boost::context::execution_context<sync*> original_context_;


Re-enable the MFEM errors for mprotect on wrong memory types

--- general/mem_manager.cpp
+++ general/mem_manager.cpp
@@ -320,9 +320,7 @@
 inline void MmuProtect(const void *ptr, const size_t bytes)
 {
    if (!::mprotect(const_cast<void*>(ptr), bytes, PROT_NONE)) { return; }
-   // Silently returning, should be only when !own and
-   // h_mt has been set with MemoryManager::host_mem_type
-   // mfem_error("mmu protection (NONE) error");
+   mfem_error("MMU protection (NONE) error");
 }

 /// MMU un-protection, through ::mprotect with read/write accesses
@@ -330,7 +328,7 @@
 {
    const int RW = PROT_READ | PROT_WRITE;
    if (!::mprotect(const_cast<void*>(ptr), bytes, RW)) { return; }
-   // mfem_error("mmu protection (R/W) error");
+   mfem_error("MMU protection (R/W) error");
 }
 #else
 inline void MmuInit() { }


WIP debug mem copy

WIP debug mem copy

--- general/mem_manager.cpp
+++ general/mem_manager.cpp
@@ -14,6 +14,7 @@

 #define MFEM_DEBUG_COLOR 84
 #include "debug.hpp"
+#define MFEM_COPY_THRESHOLD 0x10000

 #include <list>
 #include <cstring> // std::memcpy, std::memcmp
@@ -398,11 +399,20 @@
    void Alloc(Memory &base) { CuMemAlloc(&base.d_ptr, base.bytes); }
    void Dealloc(Memory &base) { CuMemFree(base.d_ptr); }
    void *HtoD(void *dst, const void *src, size_t bytes)
-   { dbg("0x%x",bytes); return CuMemcpyHtoD(dst, src, bytes); }
+   {
+      if (bytes > MFEM_COPY_THRESHOLD) { dbg("0x%x =>", bytes); }
+      return CuMemcpyHtoD(dst, src, bytes);
+   }
    void *DtoD(void* dst, const void* src, size_t bytes)
-   { return CuMemcpyDtoD(dst, src, bytes); }
+   {
+      if (bytes > MFEM_COPY_THRESHOLD) { dbg("0x%x =", bytes); }
+      return CuMemcpyDtoD(dst, src, bytes);
+   }
    void *DtoH(void *dst, const void *src, size_t bytes)
-   { return CuMemcpyDtoH(dst, src, bytes); }
+   {
+      if (bytes > MFEM_COPY_THRESHOLD) { dbg("0x%x <=", bytes); }
+      return CuMemcpyDtoH(dst, src, bytes);
+   }
 };

 /// The HIP device memory space
@@ -457,16 +467,19 @@
    { MmuAllow(MmuAddrP(ptr), MmuLengthP(ptr, bytes)); }
    void *HtoD(void *dst, const void *src, size_t bytes)
    {
-      if (bytes >= 0x10000)
-      {
-         dbg("0x%x",bytes);
-      }
+      if (bytes > MFEM_COPY_THRESHOLD) { dbg("0x%x =>", bytes); }
       return std::memcpy(dst, src, bytes);
    }
    void *DtoD(void *dst, const void *src, size_t bytes)
-   { return std::memcpy(dst, src, bytes); }
+   {
+      if (bytes > MFEM_COPY_THRESHOLD) { dbg("0x%x =", bytes); }
+      return std::memcpy(dst, src, bytes);
+   }
    void *DtoH(void *dst, const void *src, size_t bytes)
-   { return std::memcpy(dst, src, bytes); }
+   {
+      if (bytes > MFEM_COPY_THRESHOLD) { dbg("0x%x <=", bytes); }
+      return std::memcpy(dst, src, bytes);
+   }
 };

 #ifndef MFEM_USE_UMPIRE


don't allocate too much memory on the stack in web seed test

git-svn-id: 6ed3528c1be4534134272ad6dd050eeaa1f628d3@4979 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda

--- test/test_web_seed.cpp
+++ test/test_web_seed.cpp
@@ -202,24 +202,26 @@
 		{ 5, 16 - 5, 16, 17, 10, 30, 30, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
 			,1,1,1,1,1,1,13,65,34,75,2,3,4,5,23,9,43,4,43,6, 4};

-		char random_data[300000];
+		char* random_data = (char*)malloc(300000);
 		for (int i = 0; i != sizeof(file_sizes)/sizeof(file_sizes[0]); ++i)
 		{
-			std::generate(random_data, random_data + sizeof(random_data), &std::rand);
+			std::generate(random_data, random_data + 300000, &std::rand);
 			char filename[200];
 			snprintf(filename, sizeof(filename), "./tmp1_web_seed/test_torrent_dir/test%d", i);
 			save_file(filename, random_data, file_sizes[i]);
 		}

 		add_files(fs, "./tmp1_web_seed/test_torrent_dir");
+		free(random_data);
 	}
 	else
 	{
 		piece_size = 64 * 1024;
-		char random_data[64 * 1024 * 25];
-		std::generate(random_data, random_data + sizeof(random_data), &std::rand);
-		save_file("./tmp1_web_seed/seed", random_data, sizeof(random_data));
-		fs.add_file("seed", sizeof(random_data));
+		char* random_data = (char*)malloc(64 * 1024 * 25);
+		std::generate(random_data, random_data + 64 * 1024 * 25, &std::rand);
+		save_file("./tmp1_web_seed/seed", random_data, 64 * 1024 * 25);
+		fs.add_file("seed", 64 * 1024 * 25);
+		free(random_data);
 	}

 	int port = start_web_server(strcmp(protocol, "https") == 0, chunked_encoding);


don't allocate too much memory on the stack in web seed test


fix tab/spaces

fix tab/spaces

--- test/unit-renderer.cpp
+++ test/unit-renderer.cpp
@@ -445,6 +445,6 @@
     You really are <%name%>
 $$ endif
 )DELIM";
-            CHECK( env.render(string_template, data) == "Hello Peter\n	You really are Peter\n");
-    }
-}
+            CHECK( env.render(string_template, data) == "Hello Peter\n    You really are Peter\n");
+    }
+}


Disable unit test which uses hardcoded paths

--- test/unit/testcert.cpp
+++ test/unit/testcert.cpp
@@ -8,44 +8,44 @@
 using namespace Davix;

 // instanciate and play with gates
-TEST(CredTest, basicLoad){
-    DavixError* tmp_err=NULL;
-    davix_set_log_level(DAVIX_LOG_DEBUG | DAVIX_LOG_WARNING | DAVIX_LOG_TRACE);
+// TEST(CredTest, basicLoad){
+//     DavixError* tmp_err=NULL;
+//     davix_set_log_level(DAVIX_LOG_DEBUG | DAVIX_LOG_WARNING | DAVIX_LOG_TRACE);

-    Context c;
-    X509Credential cred;
+//     Context c;
+//     X509Credential cred;

-    ASSERT_FALSE(cred.hasCert());
+//     ASSERT_FALSE(cred.hasCert());

-    string cert_path(TEST_VALID_CERT);
-    string cert_pass(TEST_VALID_CERT_PASS);
+//     string cert_path(TEST_VALID_CERT);
+//     string cert_pass(TEST_VALID_CERT_PASS);

-    cout << " cred: " << cert_path << "pass " << cert_pass << endl;
+//     cout << " cred: " << cert_path << "pass " << cert_pass << endl;

-    int ret = cred.loadFromFileP12(cert_path.c_str(), cert_pass.c_str(), &tmp_err);
-    if(tmp_err){
-        cout << "err :" << tmp_err->getErrMsg() << endl;
-    }
-    ASSERT_EQ(0, ret);
-    ASSERT_EQ(NULL, tmp_err);
-    ASSERT_TRUE(cred.hasCert());
+//     int ret = cred.loadFromFileP12(cert_path.c_str(), cert_pass.c_str(), &tmp_err);
+//     if(tmp_err){
+//         cout << "err :" << tmp_err->getErrMsg() << endl;
+//     }
+//     ASSERT_EQ(0, ret);
+//     ASSERT_EQ(NULL, tmp_err);
+//     ASSERT_TRUE(cred.hasCert());

-    X509Credential cred2(cred);
-    ASSERT_TRUE(cred2.hasCert());
+//     X509Credential cred2(cred);
+//     ASSERT_TRUE(cred2.hasCert());

-    ret = cred.loadFromFileP12("/random/stupid/path", "", &tmp_err);
-    ASSERT_EQ(-1, ret);
-    ASSERT_EQ(StatusCode::CredentialNotFound, tmp_err->getStatus());
-    DavixError::clearError(&tmp_err);
-    ASSERT_FALSE(cred.hasCert());
-    ASSERT_TRUE(cred2.hasCert());
+//     ret = cred.loadFromFileP12("/random/stupid/path", "", &tmp_err);
+//     ASSERT_EQ(-1, ret);
+//     ASSERT_EQ(StatusCode::CredentialNotFound, tmp_err->getStatus());
+//     DavixError::clearError(&tmp_err);
+//     ASSERT_FALSE(cred.hasCert());
+//     ASSERT_TRUE(cred2.hasCert());

-    ret = cred.loadFromFileP12(cert_path.c_str(), "", &tmp_err);
-    ASSERT_EQ(-1, ret);
-    ASSERT_EQ(StatusCode::LoginPasswordError, tmp_err->getStatus());
-    DavixError::clearError(&tmp_err);
+//     ret = cred.loadFromFileP12(cert_path.c_str(), "", &tmp_err);
+//     ASSERT_EQ(-1, ret);
+//     ASSERT_EQ(StatusCode::LoginPasswordError, tmp_err->getStatus());
+//     DavixError::clearError(&tmp_err);

-}
+// }

 TEST(testAWS, awsToken){


From Andrei:
Minor fix for the ray tracing algorithm.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@13875 27541ba8-7e3a-0410-8455-c3a389f83636

--- geom/src/TGeoVolume.cxx
+++ geom/src/TGeoVolume.cxx
@@ -1,4 +1,4 @@
-// @(#)root/geom:$Name:  $:$Id: TGeoVolume.cxx,v 1.70 2005/11/21 09:31:47 brun Exp $
+// @(#)root/geom:$Name:  $:$Id: TGeoVolume.cxx,v 1.71 2006/01/19 11:23:08 brun Exp $
 // Author: Andrei Gheata   30/05/02
 // Divide(), CheckOverlaps() implemented by Mihaela Gheata

@@ -982,8 +982,7 @@
    Bool_t drawn = (painter->GetDrawnVolume()==this)?kTRUE:kFALSE;
    Bool_t force_update = (gPad==0)?kTRUE:kFALSE;

-   TGeoVolume *old_vol = fGeoManager->GetTopVolume();
-   if (old_vol!=this) {
+   if (!drawn) {
       fGeoManager->SetTopVolume(this);
       painter->SetRaytracing(kFALSE);
       painter->Draw();


Updated default port to something fancier.

--- server/src/server.cpp
+++ server/src/server.cpp
@@ -56,7 +56,9 @@
 	if (!flatbuffers::LoadFile(configfile.c_str(), false, &configjson)) {
 		std::cerr << "No server configuration found. Creating a default one." << std::endl;
 		flatbuffers::FlatBufferBuilder fbb;
-		auto cfg = keron::server::CreateConfiguration(fbb, fbb.CreateString("*"), 18246, 8, fbb.CreateString("server.vdb"));
+		auto cfg = keron::server::CreateConfiguration(fbb,
+				fbb.CreateString("*"),
+				('K' << 8) | ('S' << 4) | 'P', 8, fbb.CreateString("server.vdb"));
 		auto generator = flatbuffers::GeneratorOptions();
 		generator.strict_json = true;
 		FinishConfigurationBuffer(fbb, cfg);


try to make it work on Mac OS X also

try to make it work on Mac OS X also

--- configd/src/apps/su/main.cpp
+++ configd/src/apps/su/main.cpp
@@ -30,7 +30,16 @@

     gid_t grouplist[256];
     int group_arr_sz = 256;
+#ifdef __APPLE__
+    int mac_gid = g;
+    int mac_groups[256];
+    int ggl = getgrouplist(username, mac_gid, mac_groups, &group_arr_sz);
+    for (int i = 0; i < group_arr_sz; ++i) {
+        grouplist[i] = (gid_t) mac_groups[i];
+    }
+#else
     int ggl = getgrouplist(username, g, grouplist, &group_arr_sz);
+#endif

     gid_t oldg = getgid();
     uid_t oldu = getuid();
@@ -40,7 +49,7 @@
         return 1;
     }
     size_t listsize = 1;
-    if (ggl > 0) {
+    if (ggl >= 0) {
         listsize = group_arr_sz;
     } else {
         grouplist[0] = g;


Tweaked arrows to be more visible.

Tweaked arrows to be more visible.

--- gl_data_preparation.cpp
+++ gl_data_preparation.cpp
@@ -733,25 +733,29 @@
 void draw_arrow(vector3<distance> view_loc, gl_collection& coll, vector3<distance> center, cardinal_direction dir, color c) {
   vector3<distance> foo = vector3<lint64_t>(cardinal_direction_vectors[dir]) * tile_width / 3;
   vector3<distance> bar(foo.y, foo.x, 0);
-  vector3<distance> up(0, 0, tile_height / 5);
-  push_quad(coll,
-            convert_coordinates_to_GL(view_loc, center - foo),
-            convert_coordinates_to_GL(view_loc, center - foo + up),
-            convert_coordinates_to_GL(view_loc, center + foo + up),
-            convert_coordinates_to_GL(view_loc, center + foo),
-            c);
-  push_quad(coll,
-            convert_coordinates_to_GL(view_loc, center + foo),
-            convert_coordinates_to_GL(view_loc, center + foo + up),
-            convert_coordinates_to_GL(view_loc, center + bar + up),
-            convert_coordinates_to_GL(view_loc, center + bar),
-            c);
-  push_quad(coll,
-            convert_coordinates_to_GL(view_loc, center + foo),
-            convert_coordinates_to_GL(view_loc, center + foo + up),
-            convert_coordinates_to_GL(view_loc, center - bar + up),
-            convert_coordinates_to_GL(view_loc, center - bar),
-            c);
+  vector3<distance> up_a_little(0, 0, tile_height / 5);
+  vector3<distance> bar_a_little = bar * 3 / 25;
+  for (int i = 0; i < 2; ++i) {
+    vector3<distance> little_adjustment = i ? up_a_little : bar_a_little;
+    push_quad(coll,
+              convert_coordinates_to_GL(view_loc, center - foo - little_adjustment),
+              convert_coordinates_to_GL(view_loc, center - foo + little_adjustment),
+              convert_coordinates_to_GL(view_loc, center + foo + little_adjustment),
+              convert_coordinates_to_GL(view_loc, center + foo - little_adjustment),
+              c);
+    push_quad(coll,
+              convert_coordinates_to_GL(view_loc, center + foo - little_adjustment),
+              convert_coordinates_to_GL(view_loc, center + foo + little_adjustment),
+              convert_coordinates_to_GL(view_loc, center + bar + little_adjustment),
+              convert_coordinates_to_GL(view_loc, center + bar - little_adjustment),
+              c);
+    push_quad(coll,
+              convert_coordinates_to_GL(view_loc, center + foo - little_adjustment),
+              convert_coordinates_to_GL(view_loc, center + foo + little_adjustment),
+              convert_coordinates_to_GL(view_loc, center - bar + little_adjustment),
+              convert_coordinates_to_GL(view_loc, center - bar - little_adjustment),
+              c);
+  }
 }

 void prepare_shape(vector3<distance> view_loc, gl_collection& coll,
@@ -1137,7 +1141,7 @@
         }
         else if(shared_ptr<conveyor_belt> belt = dynamic_pointer_cast<conveyor_belt>(objp)) {
           prepare_shape(view_loc, coll, obj_shape, color(0xffffffaa));
-          draw_arrow(view_loc, coll, (obj_shape.bounds().min() + obj_shape.bounds().max()) / 2, belt->direction(), color(0xff0000aa));
+          draw_arrow(view_loc, coll, (obj_shape.bounds().min() + obj_shape.bounds().max()) / 2 + vector3<distance>(0,0,tile_height*2/5), belt->direction(), color(0xff0000aa));
         }
         else if(shared_ptr<refinery> ref = dynamic_pointer_cast<refinery>(objp)) {
           prepare_shape(view_loc, coll, obj_shape, color(0xffffffaa));


A spurious line was still in the code.

A spurious line was still in the code.

--- tests/PulsarSearch.cpp
+++ tests/PulsarSearch.cpp
@@ -288,7 +288,6 @@
       clQueues->at(clDeviceID)[0].enqueueNDRangeKernel(*foldingK, cl::NullRange, foldingGlobal, foldingLocal, 0, &syncPoint);
       syncPoint.wait();
       clQueues->at(clDeviceID)[0].enqueueReadBuffer(foldedData_d, CL_TRUE, 0, foldedData.size() * sizeof(dataType), reinterpret_cast< void * >(foldedData.data()));
-      output.open(outputFile + "_" + isa::utils::toString(world.rank()) + ".fold" + isa::utils::toString(second));
 		} catch ( cl::Error & err ) {
 			std::cerr << err.what() << std::endl;
 			return 1;


test strip trailing of all strip chars

test strip trailing of all strip chars

--- tests/TestStrUtils.cpp
+++ tests/TestStrUtils.cpp
@@ -548,6 +548,8 @@
    std::string withTrailingPunctuation = "now is the time,";
    std::string leadingAndTrailing = "...now is the time...";
    std::string alreadyTrimmed = "now is the time";
+   std::string onlyTrimChars = "xxxxxxxxxx";
+   const std::string empty = "";

    requireStringEquals(target, StrUtils::stripTrailing(withSingleTrailingSpace,
                                                        ' '),
@@ -562,6 +564,8 @@
            "trimmed string has leading strip chars");
    requireStringEquals(target, StrUtils::stripTrailing(alreadyTrimmed, ' '),
                        "no alteration of already trimmed string");
+   requireStringEquals(empty, StrUtils::stripTrailing(onlyTrimChars, 'x'),
+                       "string containing only char to strip");
 }

 //******************************************************************************


tests/decodeoutput: initialize m_file pointer to NULL

m_file member pointer is not initialized and will get an arbitrary
value.  If that arbitrary value is not 0, then it fools code like
"if(m_file)" into thinking it's ok to use m_file.

Thus, ensure m_file is initialized to NULL in constructor.

Fixes 01org/libyami#743

Signed-off-by: U. Artie Eoff <32aece0d55055227b44d04b7d0051cf3d04ee871@intel.com>

--- tests/decodeoutput.cpp
+++ tests/decodeoutput.cpp
@@ -337,6 +337,7 @@
 public:
     DecodeOutputMD5(const char* outputFile, const char* inputFile, uint32_t fourcc)
         : DecodeOutputFile(outputFile, inputFile, fourcc)
+        , m_file(NULL)
     {
     }
     virtual ~DecodeOutputMD5();


Fix covar and pheno checks, add additional Plink vars

--- encore.cpp
+++ encore.cpp
@@ -199,7 +199,7 @@
 	/********************************
 	 * Covar file
 	 *******************************/
-	if (vm.count("covarfile")){
+	if (vm.count("covar")){
 		// validate that covar file is used with proper modes
 		if (!(vm.count("regain") || vm.count("linear"))) {
 			cerr << "Error: Covariate file may only be used with --regain or --linear"
@@ -216,6 +216,8 @@
 		// read covariate file using PLINK
 		else {
 			par::covar_file = true;
+			par::clist = true;
+			par::clist_filename = covarfile;
 			if(!PP->readCovListFile()){
 				cerr << "Error: Problem reading the covariates" << endl;
 				return 1;
@@ -226,7 +228,7 @@
 	/********************************
 	 * Pheno file
 	 *******************************/
-	if (vm.count("phenofile")) {
+	if (vm.count("pheno")) {
 		// alternate phenotype validation
 		if (vm.count("snprank")) {
 			cerr << "Error: Alternate phenotype file cannot be used with "\
@@ -243,6 +245,7 @@
 		// read alternate phenotype file using PLINK
 		else {
 			par::pheno_file = true;
+			par::pheno_filename = phenofile;
 			if(!PP->readPhenoFile())
 				cerr << "Error: Problem reading the alternate phenotype file" << endl;
 			}


tests/memtable: fix partition_range use-after-free

--- tests/memtable_test.cc
+++ tests/memtable_test.cc
@@ -84,6 +84,7 @@
     return seastar::async([] {
         lw_shared_ptr<memtable> mt;
         std::vector<flat_mutation_reader> readers;
+        std::deque<dht::partition_range> ranges_storage;
         run_mutation_source_tests([&] (schema_ptr s, const std::vector<mutation>& muts) {
             readers.clear();
             mt = make_lw_shared<memtable>(s);
@@ -91,7 +92,7 @@
             for (auto&& m : muts) {
                 mt->apply(m);
                 // Create reader so that each mutation is in a separate version
-                flat_mutation_reader rd = mt->make_flat_reader(s, dht::partition_range::make_singular(m.decorated_key()));
+                flat_mutation_reader rd = mt->make_flat_reader(s, ranges_storage.emplace_back(dht::partition_range::make_singular(m.decorated_key())));
                 rd.set_max_buffer_size(1);
                 rd.fill_buffer(db::no_timeout).get();
                 readers.push_back(std::move(rd));


Allow storing and retrieving numerics from string columns and strings from numeric columns.

--- tests/placeholders.cpp
+++ tests/placeholders.cpp
@@ -4,7 +4,7 @@

 int main(int argc, char *argv[]) {
 	auto db = get_database(argc, argv);
-	test_init(20);
+	test_init(24);
 	db->execute("CREATE TABLE rusqltest (`value` VARCHAR(10) NOT NULL)");

 	test_start_try(6);
@@ -41,25 +41,29 @@
 	}

 	db->execute("DELETE FROM rusqltest");
+	test_start_try(2);
 	try {
 		db->execute("INSERT INTO rusqltest VALUES (?)", 5);
+		pass("Could insert numeric into string field");
 		auto res = db->query("SELECT * FROM rusqltest");
-		diag("Actually stored string: '" + res.get_string(1) + "'");
-		fail("Disallowed to enter numerics in string field");
-	} catch(std::exception &) {
-		pass("Disallowed to enter numerics in string field");
+		test(res.get_string(1) == "5", "Numeric was stored into string field correctly");
+	} catch(std::exception &e) {
+		diag(e);
 	}
+	test_finish_try();

 	db->execute("DELETE FROM rusqltest");
 	db->execute("INSERT INTO rusqltest VALUES (?)", "6");
+	test_start_try(2);
 	try {
 		auto res = db->query("SELECT * FROM rusqltest");
 		auto r = res.get_uint64(1);
-		diag("Actually retrieved numeric: " + to_string(r));
-		fail("Disallowed to retrieve numerics from string field");
-	} catch(std::exception &) {
-		pass("Disallowed to retrieve numerics from string field");
+		pass("Could retrieve numeric from string field");
+		test(r == 6, "Numeric was retrieved from string field correctly");
+	} catch(std::exception &e) {
+		diag(e);
 	}
+	test_finish_try();

 	db->execute("DROP TABLE rusqltest");
 	db->execute("CREATE TABLE rusqltest (`value` INT(2) NOT NULL)");
@@ -75,25 +79,29 @@
 	}
 	test_finish_try();

+	test_start_try(2);
 	try {
 		auto res = db->query("SELECT * FROM rusqltest");
 		auto r = res.get_string(1);
-		diag("Actually retrieved string: '" + r + "'");
-		fail("Disallowed to retrieve strings from numeric field");
-	} catch(std::exception&) {
-		pass("Disallowed to retrieve strings from numeric fields");
+		pass("Could retrieve string from numeric field");
+		test(r == "3", "Retrieved string is correct");
+	} catch(std::exception &e) {
+		diag(e);
 	}
+	test_finish_try();

 	db->execute("DELETE FROM rusqltest");
+	test_start_try(2);
 	try {
 		db->execute("INSERT INTO rusqltest VALUES (?)", "4");
+		pass("Could insert string into numeric field");
 		auto res = db->query("SELECT * FROM rusqltest");
 		auto r = res.get_uint64(1);
-		diag("Actually retrieved numeric: " + to_string(r));
-		fail("Disallowed to enter strings in numeric field");
-	} catch(std::exception&) {
-		pass("Disallowed to enter strings in numeric field");
+		test(r == 4, "Inserted string into numeric field is correct");
+	} catch(std::exception &e) {
+		diag(e);
 	}
+	test_finish_try();

 	db->execute("DROP TABLE rusqltest");
 	db->execute("CREATE TABLE rusqltest(`value` INT(2) NULL)");